Q.1

Bitwise can be used to perform addition and subtraction.

  • Yes
  • No
Q.2

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

  • Yes
  • No
Q.3

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

  • Yes
  • No
Q.4

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

  • Yes
  • No
Q.5

Bitwise can be used to generate a random number.

  • Yes
  • No
Q.6

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

  • Yes
  • No
Q.7

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

  • Yes
  • No
Q.8

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

  • Decimal system
  • Hexadecimal system
  • Octal system
  • No need to convert
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}
  • ffff
  • 0fff
  • 0000
  • fff0
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}
  • It prints all even bits from num
  • It prints all odd bits from num
  • It prints binary equivalent num
  • Error
Q.11

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

  • True
  • False
Q.12

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

  • True
  • False
Q.13

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

  • && operator
  • & operator
  • || operator
  • ! operator
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
}
  • ffff
  • 0000
  • ffdf
  • ddfd
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}
  • It counts the number of bits that are ON (1) in the number num.
  • It counts the number of bits that are OFF (0) in the number num.
  • It sets all bits in the number num to 1
  • Error
Q.16

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

  • True
  • False
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

  • True
  • False
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}
  • 4 1 8 1
  • 4 >> 1 8 >> 1
  • 2 >> 4 Garbage value >> Garbage value
  • 2 4
Q.19

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

  • && operator
  • & operator
  • || operator
  • | operator
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}
  • 32
  • 64
  • 0
  • 128
0 h : 0 m : 1 s