Top

Bitwise Operators

51.

Bitwise can be used to reverse a sign of a number.

Answer: B

No answer description available for this question.
 

Enter details here

52.

Bitwise can be used to perform addition and subtraction.

Answer: B

No answer description available for this question.
 

Enter details here

53.

What will be the output of the following C code?

#include 
    int main()
    {
        int y = 0;
        if (1 |(y = 1))
            printf("y is %d\n", y);
        else
            printf("%d\n", y);
 
    }

 

Answer: A

No answer description available for this question.

Enter details here

54.

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

55.

What will be the output of the following C code?

#include 
    int main()
    {
        unsigned int a = 10;
        a = ~a;
        printf("%d\n", a);
    }

 

Answer: C

No answer description available for this question.

Enter details here

56.

What will be the output of the program?

#include

int main()
{
    char c=48;
    int i, mask=01;
    for(i=1; i<=5; i++)
    {
        printf("%c", c|mask);
        mask = mask<<1>

 

Answer: B

No answer description available for this question.
 

Enter details here

57.

Bitwise | can be used to set a bit in number.

Answer: A

No answer description available for this question.
 

Enter details here

58.

Predict the output of following program.

#include 

int main()
{
 int a=10;
 int b=2;
 int c;
 
 c=(a & b);
 printf("c= %d",c);
 
 return 0;
}

 

Answer: C

No answer description available for this question.

Enter details here

59.

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

60.

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

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