

MCQOPTIONS
Saved Bookmarks
This section includes 72 Mcqs, each offering curated multiple-choice questions to sharpen your C++ Programming knowledge and support exam preparation. Choose a topic below to get started.
51. |
The value 231.06 can be represented using which data type? |
A. | int |
B. | void |
C. | double |
D. | bool |
E. | None of these |
Answer» D. bool | |
52. |
What is the value of the bool? |
A. | 0 |
B. | 1 |
C. | True |
D. | False |
E. | None of these |
Answer» E. None of these | |
53. |
Is bool a fundamental data type in C++? |
A. | No, it is expanded from macros |
B. | No, it is an enum of {false, true} |
C. | No, it is a typedef of unsigned char |
D. | Yes |
E. | None of these |
Answer» E. None of these | |
54. |
When a language has the capability to produce new data type mean, it can be called as |
A. | extensible |
B. | overloaded |
C. | reprehensible |
D. | encapsulated |
E. | None of these |
Answer» B. overloaded | |
55. |
Which of the two operators ++ and -- work for the bool data type in C++? |
A. | -- |
B. | ++ & -- |
C. | ++ |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
56. |
Select the right option. |
A. | i is false and ii is true |
B. | i is true but ii is false |
C. | both i and ii are false |
D. | both i and ii are true |
E. | None of these |
Answer» E. None of these | |
57. |
Which of the following belongs to the set of character types? |
A. | only a |
B. | char |
C. | wchar_t |
D. | both wchar_t and char |
E. | None of these |
Answer» E. None of these | |
58. |
How many characters are specified in the ASCII scheme? |
A. | 256 |
B. | 64 |
C. | 128 |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
59. |
Evaluate the following |
A. | true |
B. | false |
C. | 0 |
D. | 1 |
E. | None of these |
Answer» E. None of these | |
60. |
Is the size of character literals different in C and C++? |
A. | Yes, they are different |
B. | Implementation defined |
C. | No, they are not different |
D. | Can t say |
E. | None of these |
Answer» B. Implementation defined | |
61. |
In C++, what is the sign of character data type by default? |
A. | Unsigned |
B. | Implementation dependent |
C. | Signed |
D. | All of above |
E. | None of these |
Answer» C. Signed | |
62. |
How do we represent a wide character of the form wchar_t? |
A. | la |
B. | L[a]. |
C. | l a |
D. | L a |
E. | None of these |
Answer» E. None of these | |
63. |
Which of these expressions will return true if the input integer a is a power of two? |
A. | (~a & (a 1)) == 0; |
B. | (a | (a 1)) == 0; |
C. | (a & (a 1)) == 0; |
D. | (a | (a + 1)) == 0; |
E. | None of these |
Answer» D. (a | (a + 1)) == 0; | |
64. |
Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return? |
A. | 1 |
B. | Implementation dependent |
C. | Machine dependent |
D. | 4 |
E. | None of these |
Answer» B. Implementation dependent | |
65. |
Which of the following is not one of the sizes of the floating point types? |
A. | long double |
B. | double |
C. | short float |
D. | float |
E. | None of these |
Answer» D. float | |
66. |
What will be output of this program? |
A. | Compilation Error |
B. | Runtime Error |
C. | 0 5 |
D. | 5 0 |
E. | None of these |
Answer» D. 5 0 | |
67. |
What will be output of this function? |
A. | Compilation Error |
B. | Runtime Error |
C. | 15 |
D. | 10 |
E. | None of these |
Answer» D. 10 | |
68. |
0545, 451245123245, p and 0X3f are _____ _____ ____ and _____ literals respectively. |
A. | hexadecimal, octal, decimal, character |
B. | octal, decimal, character, hexadecimal |
C. | octal, hexadecimal, character, decimal |
D. | decimal, character,octal, hexadecimal |
E. | None of these |
Answer» C. octal, hexadecimal, character, decimal | |
69. |
Which of these expressions will make the rightmost set bit zero in an input integer p? |
A. | p = p | (p+1) |
B. | p = p | (p-1) |
C. | p = p & (p+1) |
D. | p = p & (p-1) |
E. | None of these |
Answer» E. None of these | |
70. |
What is the value of the following 8-bit integer after all statements are executed? |
A. | Implementation defined |
B. | -1 |
C. | 127 |
D. | 1 |
E. | None of these |
Answer» B. -1 | |
71. |
The size_t integer type in C++ is? |
A. | Unsigned integer of at least 16 bits |
B. | Signed integer of at least 64 bits |
C. | Signed integer of at least 16 bits |
D. | Unsigned integer of at least 64 bits |
E. | None of these |
Answer» B. Signed integer of at least 64 bits | |
72. |
What constant defined in |
A. | SIZE_CHAR |
B. | CHAR_SIZE |
C. | CHAR_BIT |
D. | BIT_CHAR |
E. | None of these |
Answer» D. BIT_CHAR | |