C Programming - Bitwise Operators

11. 

What will be the output of the program?

#include<stdio.h>

int main()
{
    unsigned int res;
    res = (64 >>(2+1-2)) & (~(1<<2));
    printf("%d\n", res);
    return 0;
}

A. 32
B. 64
C. 0
D. 128

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

12. 

What will be the output of the program ?

#include<stdio.h>

int main()
{
    int i=4, j=8;
    printf("%d, %d, %d\n", i|j&j|i, i|j&&j|i, i^j);
    return 0;
}

A. 4, 8, 0
B. 1, 2, 1
C. 12, 1, 12
D. 0, 0, 0

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

« Prev   1 2 3