C Programming MCQ

1: The following 'C' program { unsigned int num; int c=0 scanf("%u",&num); for(;num;num>>=1) { if(num &1) c++; } printf("%d",c); }
A. Counts the number of bits which are on in the number num
B. Sets all bits in the number num to 1
C. Sets bits in the number num to 0
D. Error
 

Answer : A

Explanation :

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.