C++ Quiz MCQ Question and Answer
Categories: C++ MCQ
C++ Quiz MCQ Question and Answer
1) Which of the following is the correct syntax to add the header file in the C++ program?
- #include<userdefined>
- #include "userdefined.h"
- <include> "userdefined.h"
- Both A and B
Answer: D
2) Which of the following is the correct syntax to print the message in C++ language?
- cout <<"Hello world!";
- Cout << Hello world! ;
- Out <<"Hello world!;
- None of the above
Answer: A
3) Which of the following is the correct identifier?
- $var_name
- VAR_123
- varname@
- None of the above
Answer: B
4) Which of the following is the address operator?
- @
- #
- &
- %
Answer: C
5) Which of the following features must be supported by any programming language to become a pure object-oriented programming language?
- Encapsulation
- Inheritance
- Polymorphism
- All of the above
Answer: D
6) The programming language that has the ability to create new data types is called.
- Overloaded
- Encapsulated
- Reprehensible
- Extensible
Answer: D
7) Which of the following is the original creator of the C++ language?
- Dennis Ritchie
- Ken Thompson
- Bjarne Stroustrup
- Brian Kernighan
Answer: C
8) Which of the following is the correct syntax to read the single character to console in the C++ language?
- Read ch()
- Getline vh()
- get(ch)
- Scanf(ch)
Answer: C
9) Which of the following statements is correct about the formal parameters in C++?
- Parameters with which functions are called
- Parameters which are used in the definition of the function
- Variables other than passed parameters in a function
- Variables that are never used in the function
Answer: A
10) The C++ language is ______ object-oriented language.
- Pure Object-oriented
- Not Object-oriented
- Semi Object-oriented or Partial Object-oriented
- None of the above
Answer: C