C Language - Operators

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

 
43.

What will be the output of the following code snippet when it is executed?

int x = 1;
float y = 1.1f;
short z = 1;
Console.WriteLine((float) x + y * z - (x += (short) y));

A. 0.1 B. 1.0
C. 1.1 D. 11




44.

What will be output if you will compile and execute the following c code?

#include
int main(){
int a=-20;
int b=-3;
printf("%d",a%b);
return 0;
}

A. 2 B. -2
C. 18 D. -18




45.

What will be output if you will compile and execute the following c code?

#include
int main(){
int a=5;
int b=10;
{
int a=2;
a++;
b++;
}
printf("%d %d",a,b);
return 0;
}

A. 5 10 B. 6 11
C. 5 11 D. 6 10




46.

What will be printed as the result of the operation below:

main()
{
int x=10, y=15;
x = x++;
y = ++y;
printf("%d %d",x,y);
}

A. 10 15 B. 11 15
C. 11 16 D. 10 16




47.

What will be printed as the result of the operation below:

main()
{
int a=0;
if(a==0)
printf("sikanth");
printf("srikanth");
}

A. sikanth B. nothing
C. sikanth
srkanth
D. error




48.

What will be printed as the result of the operation below:

main()
{
int x=5;
printf("%d,%d,%dn",x,x< <2,x>>2);
}

A. 5 20 0 B. 1 5 20
C. 5 20 1 D. error




« previous

1

2

3

4

5

6

7

8

9

next »

 
 
 



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