This problem sheet was created by Sir Narasimhan T, Assistant Professor, IT Department LBS College of Engineering, Kasaragod

The softcopy in .pdf is available here.

1. A C program contains the following declarations and initial assignments:

*int i = 8, j = 5, k;*

*float x = 0.005, y = -0.01, z;*

*char a, b, c = ’c’ , d = ’d’ ;*

Determine the value of each of the following assignment expressions

(a) 2 * ((i / 5) + (4 * (j – 3)) % (i + j – 2))

(b) (i – 3 * j) % (c + 2 * d) / (x – y)

(c) 5 * (i + j) > c

(d) (x > y) && (i > 0) || !(j < 5)

(e) k = (j==5) ? i : j

(f) z = (y >= 0) ? y : 0

(g) a = (c < d) ? c : d

(h) i -= (j > 0) ? j : 0

(i) i *= i++ * j – –i

2. Suppose that a is an unsigned integer whose value is 0xa2c3. Evaluate the following

(a) a & 0x3f06

(b) a | 0x3f06

(c) a∧0x3f06

(d) a << 3

(e) a >> 4

(f) a | ∼0x3f06 << 3

### Like this:

Like Loading...

*Related*

## Published by _bonyemmanuel

What else? Nothing much about me than what you see down the pages under opxyc.
View all posts by _bonyemmanuel