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
What will be the output of the following C code?
#include
int main()
{
int c = 2 ^ 3;
printf("%d\n", c);
}
Answer: A
No answer description available for this question.
Enter details here
Consider the given statement:
int x = 10 ^ 2
What will be the value of x?
Answer: D
No answer description available for this question.
Enter details here
Predict the output of following program.
#include
int main()
{
char flag=0x0f;
flag &= ~0x02;
printf("%d",flag);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
Left shifting an unsigned int or char by 1 is always equivalent to multiplying it by 2.
Answer: A
No answer description available for this question.
Enter details here
Left shift (<<) and Right shift (>>) operators are equivalent to _____________ by 2.
Choose the correct words...
Answer: A
No answer description available for this question.
Enter details here
Which is not a bitwise operator?
Answer: D
No answer description available for this question.
Enter details here
Bitwise | can be used to multiply a number by powers of 2.
Answer: B
No answer description available for this question.
Enter details here
Predict the output of following program.
#include
#define MOBILE 0x01
#define LAPPY 0x02
int main()
{
unsigned char item=0x00;
item |=MOBILE;
item |=LAPPY;
printf("I have purchased ...:");
if(item & MOBILE){
printf("Mobile, ");
}
if(item & LAPPY){
printf("Lappy");
}
return 1;
}
Answer: B
No answer description available for this question.
Enter details here
On left shifting, the bits from the left are rotated and brought to the right and accommodated where there is empty space on the right?
Answer: B
No answer description available for this question.
Enter details here