What will be the output of the program?
#include
int main()
{
printf("%d %d\n", 32<<1>>1, 32>>0);
printf("%d %d\n", 32>>-1, 32>>-0);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
Bitwise | can be used to set multiple bits in number.
Answer: A
No answer description available for this question.
Enter details here
If an unsigned int is 2 bytes wide then, What will be the output of the program ?
#include
int main()
{
unsigned int m = 32;
printf("%x\n", ~m);
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
Bitwise & and | are unary operators
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
int main()
{
int a = 2;
if (a >> 1)
printf("%d\n", a);
}
Answer: C
No answer description available for this question.
Enter details here
Bitwise | can be used to set a bit in number.
Answer: A
No answer description available for this question.
Enter details here
What will be the output of the program?
#define P printf("%d\n", -1^~0);
#define M(P) int main()\
{\
P\
return 0;\
}
M(P)
Answer:
Enter details here
Assunming, integer is 2 byte, What will be the output of the program?
#include
int main()
{
printf("%x\n", -1>>1);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
Bitwise & can be used to divide a number by powers of 2
Answer: B
No answer description available for this question.
Enter details here
Bitwise & can be used to check if a bit in number is set or not.
Answer: A
No answer description available for this question.
Enter details here