Classical

C Programming MCQ - I/O Operations

41:  

Following statement
printf("%f',9/5);
prints

A.

1.8

B.

1.0

C.

2.16

D.

None of these

 
 

Option: C

Explanation :


42:   What will be the value of x and y after execution of the following statement (C language)
n ==5;x=n++;y=-x;?
A. 5,4
B. 6,5
C. 5,6
D. 5,5
 
 

Option: A

Explanation :


43:  

The following 'C' program
main
{
unsigned int num;
int i;
scanf("%u",&num);
for(i=0;i<16;i++)
printf("%d",(num<<i&1<<15)?1:0);
}

A. Prints all even bits from num
B. Error
C. Prints binary equivalent of num
D. none of these
 
 

Option: C

Explanation :


44:   Output of the following 'C' program is
main
{
printf("\n%x",-1>>4);
}
A. ffff
B. 0fff
C. 0000
D. Error
 
 

Option: A

Explanation :

main
{
printf("\n%x",-1>>4);
}'>
45:   The following 'c' program main() { unsigned int m[]={0.01,0.02,0.04,0.08,0.10,0.20,0.40,0.80}; unsigned char n,i; scanf("%d",&n); for(i=0;i
A. Putting of all bits which are on in the number n
B. Testing whether the individual bits of n are on or off
C. Would give an error
D. Undefined
 
 

Option: B

Explanation :




Suggest an improvement