Question PRG-C-0048
MediumWhat is the output of this program?
#include <stdio.h>
int main() {
int n = 0;
int x = 13;
while (x) {
n += x & 1;
x >>= 1;
}
printf("%d", n);
return 0;
}
- A.
1
- B.
13
- C.
Sign up free to see the answer and a step-by-step explanation.