Question
#include<stdio.h>
int main()
{
printf("%d %dn", 32<<1, 32<<0);
printf("%d %dn", 32<<-1, 32<<-0);
printf("%d %dn", 32>>1, 32>>0);
printf("%d %dn", 32>>-1, 32>>-0);
return 0;
}
A. Garbage values
B. 64 32
0 32
16 32
0 32
C. All zeros
D. 8 0
0 0
32 0
0 16
What will be the output of the program?
#include<stdio.h>
int main()
{
printf("%d %dn", 32<<1, 32<<0);
printf("%d %dn", 32<<-1, 32<<-0);
printf("%d %dn", 32>>1, 32>>0);
printf("%d %dn", 32>>-1, 32>>-0);
return 0;
}
A. Garbage values
B. 64 32
0 32
16 32
0 32
C. All zeros
D. 8 0
0 0
32 0
0 16
Answer: Option C
Was this answer helpful ?
Answer: Option (B)
Was this answer helpful ?
Submit Solution