What will be the output of the following C code?
#include
int main()
{
int y = 1;
if (y & (y = 2))
printf("true %d\n", y);
else
printf("false %d\n", y);
}
Answer: A
No answer description available for this question.
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 in conjunction with ~ operator to turn off 1 or more bits in a number.
Answer: A
No answer description available for this question.
Enter details here
Which bitwise operator is suitable for checking whether a particular bit is on or off?
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 x = -2;
if (!0 == 1)
printf("yes\n");
else
printf("no\n");
}
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
What will be the output of the program ?
#include
int main()
{
int i=32, j=0x20, k, l, m;
k=i|j;
l=i&j;
m=k^l;
printf("%d, %d, %d, %d, %d\n", i, j, k, l, m);
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
void main()
{
int x = 4, y, z;
y = --x;
z = x--;
printf("%d%d%d", x, y, z);
}
Answer: D
No answer description available for this question.
Enter details here
Bitwise can be used to generate a random number.
Answer: B
No answer description available for this question.
Enter details here
Left shifting a number by 1 is always equivalent to multiplying it by 2.
Answer: A
No answer description available for this question.
Enter details here