[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Basic Concepts - Discussion

Home > C Programming > Basic Concepts > MCQs Questions Discussion

25 / 90

What is the output of the following 'C' program ?

#include<stdio.h>
void main()
{
unsigned  int num;
int c = 0;
scanf("%u", &num);
for(; num; num >>=1)
{
if(num & 1)
c++;
printf ("%d", c);
}
}

AIt counts the number of bits which are on in the number num

BIt sets all bits in the number num to 1

CIt sets bits in the number num to 0

DNone of these

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

No Discussion on this question yet!