1) What are Nibble, Word and Byte in computer language.?
A) Byte = 8 bits, Word= 4 Bytes, Nibble= 8 Bytes
B) Byte = 8 bits, Word=2 Bytes, Nibble=4 Bytes
C) Byte = 8 bits, Word=12 bits, Nibble=32 Bits
D) Byte = 8 bits, Word=24 bits, Nibble=40 Bits
2) Choose correct representation of Decimal number in Binary.
A)
0 0000
1 0001
2 0010
3 0011
4 0100
B)
5 0101
6 0110
7 0111
8 1000
9 1001
C)
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
Explanation:
A B C D E and F are HEX or Hexadecimal notation.
printf("%X", 10);//A
printf("%x", 10);//a
3) What is the operator used to make 1's One's compliment.?
A) & Bitwise AND Operator
C) ~ Bitwise Negate Operator
D) ^ Bitwise Exclusive OR
Explanation:
One's complement is created by Negate Operator ~.
00010110 is changed to 11101001 after applying ~ operator.
4) What is the result of 0110 & 1100.?
A) 1000
Explanation:
Bitwise & operator gives 1 if both operands are 1. 1&1 = 1.
0&0=0
0&1=0
1&0=0
1&1=1
5) What is the output of Bitwise OR operation | on (0110 | 1100).?
A) 1110
Explanation:
Bitwise OR operation compares both operands. If at least one operand is 1 output is 1.
0|0=0
0|1=1
1|0=1
1|1=1
6) What is the output of Exclusive OR ^ operator on 0110^1000.?
A) 1000
Explanation:
Exclusive OR ^ compares both operands. If both operands are different, output is 1.
0^0=1
0^1=1
1^0=1
1^1=0
7) What is the output of Left Shift Operator << on (00011000<<2).?
A) 01100000
Explanation:
Left Shift Operator << shifts bits on the left side and fills Zeroes on the Right end.
8) What is the result of Right Shift Operator >> on (00110000>>2).?
A) 11000000
Explanation:
Right Shift Operator shift bits on the right side and fills Zeroes on the left side.
9) Choose correct statement about Left Shift Operator << .?
A) Left shift operator shifts individual bits on the left side
B) When shifting left side, overflow bits are ignored.
C) Zeroes are filled on the right side
10) Choose a correct statement about Right Shift Operator >> .?
A) Right shift operator shift individual bits on to the right side.
B) When shifting bits right side, overflow bits on the right are ignored or truncated.
C) Zeroes are filled on the left side.
11) What is a Single Operand Operator below.?
A) &
Explanation:
TILDE or Negation works on single Operand. ~1100=0011.
12) What is the Bitwise operator used to set a particular bit value to 1.?
A) & AND
Explanation:
To set a 3 bit to 0 from right in 0000001, OR with 00000100. Output is 00000101.
13) What is the Bitwise operator used set a particular bit to Zero 0.?
A) & Operator
Explanation:
To set a 4th bit to 0, AND with 11110111.
00111000 & 11110111 =00110000;
14) Which is Bit Toggling operator below.?
A) & AND operator
15) Which is the format specifier used to prefix 0x and print a number in hexadecimal notation.?
A) %x
Explanation:
printf("%#x", 10);
//output: 0xa
16) Left Shift operation is equivalent to.?
A) Division by 2
Explanation:
Yes. (0001)<<1 = 0010. 1 x 2= 2 i.e 10 in binary.
17) Right Shift operation >> is equivalent to .?
A) Multiplying by 2
Explanation:
0100>>1 = 0010. So 4 / 2 = 2 = 10 in binary.
18) What is the minimum and maximum values in Octal Number System.?
A) 1 to 8
Explanation:
10 in decimal = 12 in octal = 1100 in Binary.
19) What number system is not understood by C language compiler directly.?
A) Decimal
Explanation:
Yes. C language can not understand Binary language directly. Because C language is a High Level Language.
20) Choose a correct statement about C Bitwise operators.?
A) 0^number = number