Q.1.

Bitwise can be used to perform addition and subtraction.

Q.2.

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

Q.3.

Bitwise & can be used in conjunction with ~ operator to turn off 1 or more bits in a number.

Q.4.

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

Q.5.

Bitwise can be used to generate a random number.

Q.6.

Bitwise | can be used to multiply a number by powers of 2.

Q.7.

Bitwise | can be used to set multiple bits in number.

Q.8.

In which numbering system can the binary number 1011011111000101 be easily converted to?

Q.9.

Assunming, integer is 2 byte, What will be the output of the program?

#include<stdio.h>

int main()
{
    printf("%x\n", -1>>1);
    return}
Q.10.

Which of the following statements are correct about the program?

#include<stdio.h>

int main()
{
    unsigned int num;
    int i;
    scanf("%u", &num);
    for(i=i<i++)
    {
        printf("%d", (num<<i & 1<<15)?1:0);
    }
    return}
Q.11.

Bitwise & can be used to divide a number by powers of 2

Q.12.

Left shifting a number by 1 is always equivalent to multiplying it by 2.

Q.13.

Which bitwise operator is suitable for turning off a particular bit in a number?

Q.14.

If an unsigned int is 2 bytes wide then, What will be the output of the program ?

#include<stdio.h>

int main()
{
    unsigned int m =
    printf("%x\n", ~m);
    return
}
Q.15.

Which of the following statements are correct about the program?

#include<stdio.h>

int main()
{
    unsigned int num;
    int c=    scanf("%u", &num);
    for(;num;num>>=    {
        if(num &            c++;
    }
    printf("%d", c);
    return}
Q.16.

Left shifting an unsigned int or char by 1 is always equivalent to multiplying it by 2.

Q.17.

In the statement expression1 >> expression2. if expression1 is a signed integer with its leftmost bit set to 1 then on right shifting it the result of the statement will vary from computer to computer

Q.18.

What will be the output of the program?

#include<stdio.h>

int main()
{
    printf("%d >> %d %d >> %d\n", 4 >>8 >> 1);
    return}
Q.19.

Which bitwise operator is suitable for turning on a particular bit in a number?

Q.20.

What will be the output of the program?

#include<stdio.h>

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