Top

Bitwise Operators

61.

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

62.

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

63.

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

64.

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

65.

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

66.

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

67.

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

68.

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

69.

Bitwise can be used to generate a random number.

Answer: B

No answer description available for this question.
 

Enter details here

70.

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

Loading…
Tags: Bitwise Operators Questions and Answers || Bitwise Operators MCQ Questions and Answers || Bitwise Operators GK Questions and Answers || Bitwise Operators GK MCQ Questions || Bitwise Operators Multiple Choice Questions and Answers || Bitwise Operators GK || GK on Bitwise Operators || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming