C Language - Operators

You Are Here :: Home > C Language > Operators - General Questions

 
31.

. Find the output :

main()
{
printf("%x",-1<<4);
}

A. ff00 B. fff0
C. ffff D. f000




32.

What will be the value of x after the following section of code executes:

int x = 5;
if (x > 3)
x = x - 2;
else
x = x + 2;

A. 1 B. 3
C. 5 D. 7




33.

What will be the value of y after the following section of code executes:

int y = 4, z = 3;
if (y > 4)
{
z = 2;
y = y - 1;
}
else
z = 1;
y = z;

A. 1 B. 2
C. 3 D. 4




34.

What will be the value of w after the following section of code executes:

int w = 4, q = 3;
if (q > 5)
if (w == 7)
w = 3;
else
w = 2;
else
if (w > 3)
w = 1;
else
w = 0;

A. 0 B. 1
C. 2 D. 3




35.

What will be the value of b after the following section of code executes:

int a = 4, b = 0;
if (a < 5)
b = 4;
else if (a < 10)
b = 3;
else if (a > 5)
b = 2;
else
b = 1;

A. 1 B. error
C. 3 D. 4




36.

. What will the following code print?

int count = 1;
while (count <= 3)
{
System.out.print(count + " ");
count++;
}

A. 1 2 3 B. 1 2
C. 3 D. 1 1 1




« previous

1

2

3

4

5

6

7

8

9

next »

 
 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on