C Programming MCQ - I/O Operations

41:   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 :

Click on Discuss to view users comments.

Write your comments here:



42:  

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 :

Click on Discuss to view users comments.

senthil said: (9:38pm on Saturday 25th February 2017)
in this question main is printed Instead of main() will it work?

Write your comments here:



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

Option: A

Explanation :

Click on Discuss to view users comments.

Write your comments here:


main
{
printf("\n%x",-1>>4);
}'>
44:   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 :

Click on Discuss to view users comments.

Write your comments here:



45:   In a 'C' program, constant is defined
A. Before main
B. After main
C. Anywhere, but starting on a new line
D. Any where in the program
 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here: