

MCQOPTIONS
Saved Bookmarks
This section includes 36 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. |
What is the output of this program?
|
A. | 100 |
B. | 11 |
C. | 1.0 |
D. | Compilation Error |
E. | None of these |
Answer» C. 1.0 | |
2. |
What is the output of this program?
|
A. | 2 |
B. | 20 |
C. | 10 |
D. | Any two number from 1 to 20 |
E. | Compilation Error |
Answer» E. Compilation Error | |
3. |
What is the output of this program?
|
A. | 34 |
B. | Compilation Error |
C. | 50 |
D. | Any number from 0 to 49 |
E. | None of these |
Answer» B. Compilation Error | |
4. |
What is the output of this program?
|
A. | (7,8) |
B. | (4,6) |
C. | (8,7) |
D. | (6,4) |
E. | None of these |
Answer» B. (4,6) | |
5. |
What is the output of this program?
|
A. | (3.0, 9.0) |
B. | (3.0, 2.0) |
C. | (9.0, 3.0) |
D. | (-72,54) |
E. | (-54,72) |
Answer» E. (-54,72) | |
6. |
What is the output of this program?
|
A. | 10.0 |
B. | 4.0 |
C. | 4 |
D. | 10 |
E. | None of these |
Answer» D. 10 | |
7. |
What is the output of this program?
|
A. | (3.79891,5.11179) |
B. | (5.11179,3.79891) |
C. | 5.11179 |
D. | 3.79891 |
E. | None of these |
Answer» B. (5.11179,3.79891) | |
8. |
What is the output of this program?
|
A. | 767 |
B. | 327 |
C. | 32767 |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
9. |
What is the output of this program?
|
A. | true |
B. | false |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» C. Compilation Error | |
10. |
What is the output of this program?
|
A. | 150 |
B. | 12 |
C. | 22 |
D. | 33 |
E. | 47 |
Answer» F. | |
11. |
What is the output of this program?
|
A. | 21 |
B. | 31 |
C. | 200 |
D. | 137 |
E. | None of these |
Answer» E. None of these | |
12. |
What is the output of this program?
|
A. | Depends on the compiler |
B. | Compilation Error |
C. | Runtime Error |
D. | Garbage value |
E. | None of these |
Answer» B. Compilation Error | |
13. |
What is the output of this program?
|
A. | 9383 |
B. | 18042 |
C. | 1804289383 |
D. | 0 to RAND_MAX |
E. | None of these |
Answer» E. None of these | |
14. |
What is the output of this program?
|
A. | 125 |
B. | 123 |
C. | 124 |
D. | -125 |
E. | -100 |
Answer» E. -100 | |
15. |
What is the output of this program?
|
A. | 100000000 |
B. | 15 |
C. | 6 |
D. | All of above |
E. | None of these |
Answer» B. 15 | |
16. |
What is the output of this program?
|
A. | 1100 |
B. | 1001 |
C. | 0011 |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
17. |
What is the output of this program?
|
A. | 11 23 36 |
B. | 50 65 0 |
C. | 23 36 50 |
D. | 11 23 36 50 65 0 |
E. | None of these |
Answer» E. None of these | |
18. |
What is the output of this program?
|
A. | 110 |
B. | 12 |
C. | 25 |
D. | 53 |
E. | 200 |
Answer» F. | |
19. |
What is the output of this program?
|
A. | 11 1 1 2 2 |
B. | 11 1 1 2 |
C. | 1 2 2 |
D. | 1 2 |
E. | 1 |
Answer» B. 11 1 1 2 | |
20. |
What is the output of this program?
|
A. | Complex Number: (4.90674,4.74221)(2,4) |
B. | Compilation Error |
C. | Runtime Error |
D. | Complex Number: (2,4)(4.90674,4.74221) |
E. | None of these |
Answer» E. None of these | |
21. |
What is the output of this program?
|
A. | (8,7) |
B. | (7,0) |
C. | (7,8) |
D. | (8,0) |
E. | None of these |
Answer» D. (8,0) | |
22. |
What is the default operation of adjacent_difference function in numeric library? |
A. | Multiplication |
B. | Addition |
C. | Difference |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
23. |
How many parameters are available in srand function? |
A. | 4 |
B. | 3 |
C. | 2 |
D. | 1 |
E. | None of these |
Answer» B. 3 | |
24. |
Which is a constant defined in
|
A. | Rand |
B. | Srand |
C. | RAND_MAX |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
25. |
How many parameters are available in partial_sum function in c++? |
A. | 3 or 4 |
B. | 2 or 3 |
C. | 3 |
D. | 2 |
E. | None of these |
Answer» B. 2 or 3 | |
26. |
Which header file is used to create the pseudo random generator? |
A. | cstdlib |
B. | random |
C. | both random and cstdlib |
D. | rand |
E. | None of these |
Answer» D. rand | |
27. |
Which operator is used to produce a certain number in a specific range? |
A. | % |
B. | modulo operator |
C. | both % and modulo operator |
D. | $ |
E. | None of these |
Answer» D. $ | |
28. |
Which can be used to create a random number without duplication? |
A. | number |
B. | Character |
C. | Time |
D. | Both Character & Time |
E. | None of these |
Answer» D. Both Character & Time | |
29. |
Which header file is used to declare the complex number? |
A. | complex number |
B. | complexnum |
C. | complex |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
30. |
What will the max function in the numeric limit will return for type float? |
A. | Maximum finite value |
B. | Minimum finite value |
C. | Maximum finite value for a float type |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
31. |
Where does the member should be defined if it is used in the program? |
A. | Scope |
B. | Namespace scope |
C. | Character scope |
D. | Namespace & Character scope |
E. | None of these |
Answer» C. Character scope | |
32. |
To which type does the numeric limits are suitable? |
A. | Arithmetic types |
B. | Character types |
C. | Mixed type |
D. | All of above |
E. | None of these |
Answer» B. Character types | |
33. |
Pick out the incorrect static function member in numeric limits. |
A. | max_finite |
B. | infinity |
C. | digits |
D. | denorm_min |
E. | None of these |
Answer» B. infinity | |
34. |
Which header file is used for the numeric limits in C++? |
A. | <limits> |
B. | <number> |
C. | <iostream> |
D. | All of above |
E. | None of these |
Answer» B. <number> | |
35. |
Which header file is used to operate on numeric sequences? |
A. | algorithm |
B. | number |
C. | numeric |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
36. |
Which of the following is not a function of complex values? |
A. | cartesian |
B. | norm |
C. | imag |
D. | real |
E. | None of these |
Answer» B. norm | |