Which of the following statements are correct about the program? #includeint main(){ unsigned int num; int c=0;
Fantastic news! We've Found the answer you've been seeking!
Question:
Which of the following statements are correct about the program?
#includeint main(){ unsigned int num; int c=0; scanf("%u", &num); for(;num;num>>=1) { if(num & 1) c++; } printf("%d", c); return 0;}It counts the number of bits that are ON (1) in the number num.
It counts the number of bits that are OFF (0) in the number num.
It sets all bits in the number num to 1
Error
Related Book For
Fundamentals of Investments Valuation and Management
ISBN: 978-0077283292
5th edition
Authors: Bradford D. Jordan, Thomas W. Miller
Posted Date: