

MCQOPTIONS
Saved Bookmarks
This section includes 41 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
1. |
If an is 2 bytes wide then, What will be the output of the program ? |
A. | ffff |
B. | 0000 |
C. | 00ff |
D. | ddfd |
Answer» B. 0000 | |
2. |
Left shifting an or by 1 is always equivalent to multiplying it by 2. |
A. | True |
B. | False |
Answer» B. False | |
3. |
In the statement . if 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 |
A. | True |
B. | False |
Answer» B. False | |
4. |
In which numbering system can the binary number be easily converted to? |
A. | Decimal system |
B. | Hexadecimal system |
C. | Octal system |
D. | No need to convert |
Answer» C. Octal system | |
5. |
Which of the following statements are correct about the program?
#include |
A. | It prints all even bits from num |
B. | It prints all odd bits from num |
C. | It prints binary equivalent num |
D. | Error |
Answer» D. Error | |
6. |
Which of the following statements are correct about the program?_x000D_
#include
|
A. | It will put OFF all bits that are ON in the number n |
B. | It will test whether the individual bits of n are ON or OFF |
C. | It will put ON all bits that are OFF in the number n |
D. | It will report compilation errors in the if statement. |
Answer» C. It will put ON all bits that are OFF in the number n | |
7. |
If an unsigned int is 2 bytes wide then, What will be the output of the program ?_x000D_
#include
|
A. | ffff |
B. | 0000 |
C. | ffdf |
D. | ddfd |
Answer» D. ddfd | |
8. |
What will be the output of the program ?_x000D_
#include
|
A. | 4, 8, 0 |
B. | 1, 2, 1 |
C. | 12, 1, 12 |
D. | 0, 0, 0 |
Answer» D. 0, 0, 0 | |
9. |
What will be the output of the program ?_x000D_
#include
|
A. | 0, 0, 0, 0, 0 |
B. | 0, 32, 32, 32, 32 |
C. | 32, 32, 32, 32, 0 |
D. | 32, 32, 32, 32, 32 |
Answer» D. 32, 32, 32, 32, 32 | |
10. |
What will be the output of the program?
#include
|
A. | Garbage values |
B. | 64 320 3216 320 32 |
C. | All zeros |
D. | 8 00 032 00 16 |
Answer» C. All zeros | |
11. |
What will be the output of the program? #define P printf("%d\n", -1^~0); #define M(P) int main()\ {\ P\ return 0;\ } M(P) |
A. | 1 |
B. | 0 |
C. | -1 |
D. | 2 |
Answer» C. -1 | |
12. |
What will be the output of the program ?
#include
|
A. | 0, 0, 0, 0, 0 |
B. | 0, 32, 32, 32, 32 |
C. | 32, 32, 32, 32, 0 |
D. | 32, 32, 32, 32, 32 |
Answer» D. 32, 32, 32, 32, 32 | |
13. |
What will be the output of the program?
#include
|
A. | 12400 |
B. | 12480 |
C. | 12500 |
D. | 12556 |
Answer» C. 12500 | |
14. |
Bitwise | can be used to set a bit in number. |
A. | Yes |
B. | No |
Answer» B. No | |
15. |
What will be the output of the program ?
#include
|
A. | 4, 8, 0 |
B. | 1, 2, 1 |
C. | 12, 1, 12 |
D. | 0, 0, 0 |
Answer» D. 0, 0, 0 | |
16. |
Left shifting an unsigned int or char by 1 is always equivalent to multiplying it by 2. |
A. | 1 |
B. | |
Answer» B. | |
17. |
On left shifting, the bits from the left are rotated and brought to the right and accommodated where there is empty space on the right? |
A. | 1 |
B. | |
Answer» C. | |
18. |
Bitwise can be used to perform addition and subtraction. |
A. | Yes |
B. | No |
C. | Yes |
D. | No |
Answer» C. Yes | |
19. |
Bitwise | can be used to multiply a number by powers of 2. |
A. | Yes |
B. | No |
Answer» C. | |
20. |
Bitwise & and | are unary operators |
A. | 1 |
B. | |
Answer» C. | |
21. |
Which of the following statements are correct about the program?
#include
|
A. | It converts a number to a given base. |
B. | It converts a number to its equivalent binary. |
C. | It converts a number to its equivalent hexadecimal. |
D. | It converts a number to its equivalent octal. |
Answer» B. It converts a number to its equivalent binary. | |
22. |
If an unsigned int is 2 bytes wide then, What will be the output of the program ?
#include
|
A. | ffff |
B. | 0 |
C. | 00ff |
D. | ddfd |
Answer» B. 0 | |
23. |
Bitwise | can be used to set multiple bits in number. |
A. | Yes |
B. | No |
Answer» B. No | |
24. |
Which of the following statements are correct about the program?
#include
|
A. | It counts the number of bits that are ON (1) in the number num. |
B. | It counts the number of bits that are OFF (0) in the number num. |
C. | It sets all bits in the number num to 1 |
D. | Error |
Answer» B. It counts the number of bits that are OFF (0) in the number num. | |
25. |
Bitwise can be used to reverse a sign of a number. |
A. | Yes |
B. | No |
Answer» C. | |
26. |
Assuming a integer 2-bytes, What will be the output of the program?
#include
|
A. | ffff |
B. | fff8 |
C. | 0  |
D. | -1 |
Answer» C. 0¬† | |
27. |
Bitwise & can be used to divide a number by powers of 2 |
A. | 1 |
B. | |
C. | 1 |
D. | |
Answer» C. 1 | |
28. |
Which of the following statements are correct about the program?
#include
|
A. | It will put OFF all bits that are ON in the number n |
B. | It will test whether the individual bits of n are ON or OFF |
C. | It will put ON all bits that are OFF in the number n |
D. | It will report compilation errors in the if statement. |
Answer» C. It will put ON all bits that are OFF in the number n | |
29. |
What will be the output of the program?
#include
|
A. | 32 |
B. | 64 |
C. | 0 |
D. | 128 |
Answer» B. 64 | |
30. |
If an unsigned int is 2 bytes wide then, What will be the output of the program ?
#include
|
A. | ffff |
B. | 0 |
C. | ffdf |
D. | ddfd |
Answer» D. ddfd | |
31. |
Bitwise can be used to generate a random number. |
A. | Yes |
B. | No |
Answer» C. | |
32. |
Bitwise & can be used to check if more than one bit in a number is on. |
A. | 1 |
B. | |
Answer» B. | |
33. |
What will be the output of the program?
#include
|
A. | 0 |
B. | 256 |
C. | 100 |
D. | 80 |
Answer» C. 100 | |
34. |
What will be the output of the program?
#include
|
A. | 4 1 8 1 |
B. | 4 >> 1 8 >> 1 |
C. | 2 >> 4 Garbage value >> Garbage value |
D. | 2 4 |
Answer» D. 2 4 | |
35. |
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 |
A. | 1 |
B. | |
Answer» B. | |
36. |
Bitwise & can be used to check if a bit in number is set or not. |
A. | 1 |
B. | |
Answer» B. | |
37. |
Assunming, integer is 2 byte, What will be the output of the program?
#include
|
A. | ffff |
B. | 0fff |
C. | 0 |
D. | fff0 |
Answer» B. 0fff | |
38. |
Bitwise & can be used in conjunction with ~ operator to turn off 1 or more bits in a number. |
A. | Yes |
B. | No |
C. | Yes |
D. | No |
Answer» B. No | |
39. |
Which bitwise operator is suitable for checking whether a particular bit is on or off? |
A. | && operator |
B. | & operator |
C. | || operator |
D. | ! operator |
Answer» C. || operator | |
40. |
Left shifting a number by 1 is always equivalent to multiplying it by 2. |
A. | 1 |
B. | |
C. | 1 |
D. | |
Answer» B. | |
41. |
In which numbering system can the binary number 1011011111000101 be easily converted to? |
A. | Decimal system |
B. | Hexadecimal system |
C. | Octal system |
D. | No need to convert |
Answer» C. Octal system | |