Top

Discussion

Which of the following statements are correct about the program?

#include

int main()
{
    unsigned int num;
    int c=0;
    scanf("%u", #);
    for(;num;num>>=1)
    {
        if(num & 1)
            c++;
    }
    printf("%d", c);
    return 0;
}

 

  • A.It counts the number of bits that are ON (1) in the number num.
  • B.It counts the number of bits that are OFF (0) in the number num.
  • C.It sets all bits in the number num to 1
  • D.Error

Answer: A

No answer description available for this question.

No comment is present. Be the first to comment.
Loading…

Post your comment