30/09/2018, 16:18
Poll: Kiểm tra kiến thức C - 4.11
Let’s have a discussion about this problem and get the answer here http://www.indiabix.com/online-test/c-programming-test/14
11. Which of the following statements are correct about the program?
#include<stdio.h>
int main()
{
unsigned int num;
int i;
scanf("%u", &num);
for(i=0; i<16; i++)
{
printf("%d", (num<<i & 1<<15)?1:0);
}
return 0;
}
- A. It prints all even bits from num
- B. It prints all odd bits from num
- C. It prints binary equivalent num
- D. Error
Bài liên quan
bài này khó, vẫn chưa hiểu lắm