

MCQOPTIONS
This section includes 226 Mcqs, each offering curated multiple-choice questions to sharpen your Engineering knowledge and support exam preparation. Choose a topic below to get started.
1. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 1. |
B. | The program will print the output 24. |
C. | The program will print the output 120. |
D. | The program will print the output garbage value. |
E. | The program will report compile time error. |
Answer» C. The program will print the output 120. | |
2. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 0. |
B. | The program will print the output 10. |
C. | The program will print the output 30. |
D. | The program will print the output 40. |
E. | The program will report compile time error. |
Answer» B. The program will print the output 10. | |
3. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output x = 65. |
B. | The program will print the output x = 66. |
C. | The program will print the output x = 130. |
D. | The program will print the output x = 180. |
E. | The program will not compile successfully. |
Answer» E. The program will not compile successfully. | |
4. |
What will be the output of the following program?
|
A. | 65 65 65 |
B. | 65 66 67 |
C. | A A A |
D. | A B C |
E. | The program will report compile time error. |
Answer» B. 65 66 67 | |
5. |
What will be the output of the following program?
|
A. | A A A |
B. | A B A |
C. | A B C |
D. | Garbage Garbage Garbage |
E. | The program will report compile time error. |
Answer» B. A B A | |
6. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 0. |
B. | The program will print the output 120. |
C. | The program will report run-time error. |
D. | The program will report compile-time error. |
E. | The program will print the output garbage value. |
Answer» E. The program will print the output garbage value. | |
7. |
What will be the output of the following program?
|
A. | 7 20 |
B. | 7 19.8 |
C. | 7 Garbage |
D. | 7 20.8 |
Answer» E. | |
8. |
What will be the output of the following program?
|
A. | 21 |
B. | 22 |
C. | 31 |
D. | 32 |
E. | None of these |
Answer» E. None of these | |
9. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 32 0. |
B. | The program will print the output 32 garbage-value. |
C. | The program will print the output 32 1. |
D. | The program will report compile time error. |
Answer» E. | |
10. |
What will be the out of the following program?
|
A. | 0 |
B. | 100 |
C. | 200 |
D. | 400 |
E. | The program will report compile time error. |
Answer» D. 400 | |
11. |
What will be the out of the following program?
|
A. | 11 22 0 0 |
B. | 11 0 0 22 |
C. | 11 0 22 0 |
D. | 11 22 11 22 |
E. | The program will report compile time error. |
Answer» D. 11 22 11 22 | |
12. |
What will be the out of the following program?
|
A. | 11 22 0 0 |
B. | 11 11 0 22 |
C. | 11 11 11 0 |
D. | 11 11 11 22 |
E. | The program will report compile time error. |
Answer» E. The program will report compile time error. | |
13. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 0. |
B. | The program will print the output 1. |
C. | The program will print the output 2. |
D. | The program will print the output garbage value. |
E. | The program will report compile time error. |
Answer» D. The program will print the output garbage value. | |
14. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 12. |
B. | The program will print the output 16. |
C. | The program will print the output 32. |
D. | The program will print the output 36. |
E. | The program will execute infinite time. |
Answer» D. The program will print the output 36. | |
15. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 19 31. |
B. | The program will print the output 20 30. |
C. | The program will print the output 21 31. |
D. | The program will print the output 21 29. |
E. | Program will report compile time error. |
Answer» D. The program will print the output 21 29. | |
16. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 5. |
B. | The program will print the output 8. |
C. | The program will print the output 40. |
D. | The program will report compile time error. |
Answer» E. | |
17. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 12 97.50 b. |
B. | The program will print the output 12 97.50 a. |
C. | The program will print the output 12 98 a. |
D. | The program will print the output 12 Garbage b. |
E. | The program will print the output 12 Garbage a. |
Answer» D. The program will print the output 12 Garbage b. | |
18. |
What will be the output of the following program?
|
A. | 123 |
B. | 321 |
C. | 345 |
D. | 12345 |
E. | 54321 |
Answer» D. 12345 | |
19. |
What is correct about the following program?
|
A. | The program will print the output 20. |
B. | The program will report run time error. |
C. | The program will print the garbage value. |
D. | Compilation fails due to 'operator +' cannot have default arguments. |
Answer» E. | |
20. |
What will be the output of the following program?
|
A. | 300 |
B. | 200 |
C. | Garbage value |
D. | 400 |
Answer» E. | |
21. |
What will be the output of the following program?
|
A. | Java Programming! |
B. | C++ Programming! |
C. | Learn C++ Programming! |
D. | Learn Java Programming! |
E. | Learn Java C++ Programming! |
Answer» E. Learn Java C++ Programming! | |
22. |
What will be the output of the following program?
|
A. | 30 10 20 |
B. | Garbage 10 20 |
C. | 40 50 20 |
D. | 20 40 50 |
E. | 40 Garbage Garbage |
Answer» D. 20 40 50 | |
23. |
What will be the output of the following program?
|
A. | 130 |
B. | A0 |
C. | B0 |
D. | 90 |
Answer» C. B0 | |
24. |
What will be the output of the following program?
|
A. | 20 10 |
B. | 30 20 |
C. | 20 30 |
D. | 30 40 |
E. | 50 30 |
Answer» D. 30 40 | |
25. |
Which of the following statement is correct about the program given below?
|
A. | The program will display the output 4 3 2 3 2 1 2 1 0. |
B. | The program will display the output 0 1 2 1 2 3 2 3 4. |
C. | The program will display the output 9 garbage values. |
D. | The program will report error on compilation. |
Answer» C. The program will display the output 9 garbage values. | |
26. |
Which of the following statement is correct about the program given below?
|
A. | Above program will display IndiaBIX 8. |
B. | Above program will display IndiaBIX 9. |
C. | Above program will display size of integer. |
D. | Above program will display IndiaBIX and size of integer. |
E. | Above program will display 1. |
Answer» C. Above program will display size of integer. | |
27. |
What will be the output of the following program?
|
A. | 10 10 |
B. | 12 10 |
C. | 12 21 |
D. | 12 31 |
E. | The program will report compilation error. |
Answer» B. 12 10 | |
28. |
What will be the output of the following program?
|
A. | 6 |
B. | 8 |
C. | 9 |
D. | 15 |
E. | 16 |
Answer» B. 8 | |
29. |
What will be the output of the following program?
|
A. | 3 2 |
B. | 8 3 |
C. | 11 6 |
D. | 11 10 |
E. | The program will not compile successfully. |
Answer» D. 11 10 | |
30. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 1 0 3. |
B. | The program will print the output 1 0 4. |
C. | The program will print the output 1 1 3. |
D. | The program will print the output 1 1 4. |
E. | The program will report compile time error. |
Answer» C. The program will print the output 1 1 3. | |
31. |
Which of the following statement is correct about the program given below?
|
A. | The program will report error on compilation. |
B. | The program will display 9 garbage values. |
C. | The program will display NULL 9 times. |
D. | The program will display 0 1 2 1 2 3 2 3 4. |
Answer» C. The program will display NULL 9 times. | |
32. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 2. |
B. | The program will print the output 12. |
C. | The program will report run time error. |
D. | The program will not compile successfully. |
Answer» E. | |
33. |
What will be the output of the following program?
|
A. | 5 6 3 9 0 |
B. | 0 9 3 6 5 |
C. | 0 5 6 3 9 |
D. | 0 6 3 9 5 |
E. | None of these |
Answer» E. None of these | |
34. |
What will be the output of the following program?
|
A. | 99 |
B. | ASCII value of 99 |
C. | Garbage value |
D. | 99.50 |
Answer» C. Garbage value | |
35. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 25. |
B. | The program will print the output Garbage-value. |
C. | The program will report compile time error. |
D. | The program will report runtime error. |
Answer» D. The program will report runtime error. | |
36. |
What will be the output of the following program?
|
A. | 237 |
B. | 242 |
C. | 240 |
D. | 35 |
E. | The program will report error on compilation. |
Answer» B. 242 | |
37. |
What will be the output of the following program?
|
A. | 8 |
B. | 6 |
C. | -6 |
D. | -8 |
Answer» D. -8 | |
38. |
What will be the output of the following program?
|
A. | a = 20 b = 40 |
B. | a = 20 b = 30 |
C. | a = 20 b = Garbage |
D. | a = Garbage b = 40 |
Answer» C. a = 20 b = Garbage | |
39. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 10 20. |
B. | The program will print the output 10 0. |
C. | The program will print the output 10 garbage. |
D. | The program will report compile time error. |
Answer» B. The program will print the output 10 0. | |
40. |
What will be the output of the following program?
|
A. | 10 |
B. | 20 |
C. | 30 |
D. | 40 |
E. | Compilation fails. |
Answer» D. 40 | |
41. |
Which of the following can access private data members or member functions of a class? |
A. | Any function in the program. |
B. | All global functions in the program. |
C. | Any member function of that class. |
D. | Only public member functions of that class. |
Answer» D. Only public member functions of that class. | |
42. |
Constructor is executed when _____. |
A. | an object is created |
B. | an object is used |
C. | a class is declared |
D. | an object goes out of scope. |
Answer» B. an object is used | |
43. |
Which of the following also known as an instance of a class? |
A. | Friend Functions |
B. | Object |
C. | Member Functions |
D. | Member Variables |
Answer» C. Member Functions | |
44. |
Which of the following type of data member can be shared by all instances of its class? |
A. | Public |
B. | Inherited |
C. | Static |
D. | Friend |
Answer» D. Friend | |
45. |
Which of the following statements about virtual base classes is correct? |
A. | It is used to provide multiple inheritance. |
B. | It is used to avoid multiple copies of base class in derived class. |
C. | It is used to allow multiple copies of base class in a derived class. |
D. | It allows private members of the base class to be inherited in the derived class. |
Answer» C. It is used to allow multiple copies of base class in a derived class. | |
46. |
Which of the following statements is correct when a class is inherited publicly? |
A. | Public members of the base class become protected members of derived class. |
B. | Public members of the base class become private members of derived class. |
C. | Private members of the base class become protected members of derived class. |
D. | Public members of the base class become public members of derived class. |
Answer» E. | |
47. |
Which of the following access specifies is used in a class definition by default? |
A. | Protected |
B. | Public |
C. | Private |
D. | Friend |
Answer» D. Friend | |
48. |
Which of the following statements is correct about the constructors and destructors? |
A. | Destructors can take arguments but constructors cannot. |
B. | Constructors can take arguments but destructors cannot. |
C. | Destructors can be overloaded but constructors cannot be overloaded. |
D. | Constructors and destructors can both return a value. |
Answer» C. Destructors can be overloaded but constructors cannot be overloaded. | |
49. |
What will be the output of the following program?
|
A. | 0 9 3 6 5 |
B. | 9 3 6 5 0 |
C. | 5 6 3 9 0 |
D. | 5 9 3 6 0 |
Answer» B. 9 3 6 5 0 | |
50. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 0. |
B. | The program will print the output 33. |
C. | The program will print the output Garbage. |
D. | The program will report compile time error. |
Answer» E. | |