What will be the output of the program?
#include
int main()
{
printf("%d >> %d %d >> %d\n", 4 >> 1, 8 >> 1);
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
Which bitwise operator is suitable for turning on a particular bit in a number?
Answer: D
No answer description available for this question.
Enter details here
Which bitwise operator is suitable for turning off a particular bit in a number?
Answer: B
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
What will be the output of the program ?
#include
int main()
{
int i=4, j=8;
printf("%d, %d, %d\n", i|j&j|i, i|j&&j|i, i^j);
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
Which of the following statements are correct about the program?
#include
int main()
{
unsigned int m[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
unsigned char n, i;
scanf("%d", &n);
for(i=0; i<=7; i++)
{
if(n & m[i])
printf("yes");
}
return 0;
}
Answer: B
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
Which bitwise operator is suitable for turning on a particular bit in a number?
Answer: D
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
0001 => 1
0010 => 2
0100 => 4
1000 => 8
Enter details here
Bitwise & can be used to check if more than one bit in a number is on.
Answer: A
No answer description available for this question.
Enter details here