C Programming-Bitwise Operators
Question 1
|
What is the output of this C code?
1
| |
8
| |
9
| |
0
|
Question 2
|
What is the output of this C code?
-9
| |
-10
| |
-11
| |
10
|
Question 3
|
What is the output of this C code?
Honesty is the best policy
| |
Honesty
| |
is the best policy
| |
No output
|
Question 4
|
What is the output of this C code?
0
| |
1
| |
2
| |
No Output.
|
Question 5
|
Comment on the output of this C code?
Logical Shift left
| |
No output
| |
Arithmetic Shift right
| |
bitwise exclusive OR
|
Question 6
|
What is the output of this C code?
x is 97
| |
x is 98
| |
x is 99
| |
Run time error
|
Question 7
|
What is the output of this C code?
3 2 3
| |
2 2 3
| |
3 2 2
| |
2 3 3
|
Question 8
|
What is the output of this C code?
4
| |
8
| |
1
| |
Run time error
|
Question 9
|
What is the output of this C code?
6 -6 0 0
| |
6 -5 0 1
| |
-6 -6 0 1
| |
6 -6 0 1
|
Question 10
|
What is the output of this C code?
-3
| |
-5
| |
4
| |
Undefined
|
Question 11
|
What is the output of this C code?
4
| |
1
| |
Depends on the compiler
| |
Depends on the endianness of the machine
|
Question 12
|
What is the output of this C code?
1
| |
-1
| |
2 ^ 31 – 1 considering int to be 4 bytes
| |
Either b or c
|
Question 13
|
What is the output of this C code?
yes
| |
no
| |
Compile time error
| |
Undefined
|
Question 14
|
What is the output of this C code?
yes
| |
no
| |
Run time error
| |
Undefined
|
Question 15
|
What is the output of this C code?
1
| |
0
| |
Run time error
| |
Undefined
|
Question 16
|
What is the output of this C code?
true 2
| |
false 2
| |
Either option a or option b
| |
true 1
|
Check Your Answers:
1. A
2. C
3. C
4. C
5. B
6. A
7. D
8. C
9. D
10. A
11. A
12. A
13. C
14. A
15. A
16 C
0 comments:
Post a Comment