C++ Programming Questions and Answers


C++ is a programming language that is part of the Object Oriented Programming System. This language was developed by Bjarne Stroustrup in 1985.

It uses abstraction of data using a concept named 'classes', among other features, to allow object-oriented programming. The main purpose of C++ programming was to add object-oriented concepts to the already available C programming.

In today's time, Object Oriented Programming is considered as the best in programming. Programs written in the C++ programming language can be run on operating systems such as Unix, Linux, Windows, etc.

Check some important C++ questions answers, which will help you in interview and exams.


Q 31. If a program uses Inline Function, then the function is expanded inline at _______ ?
Ans. Run time
Q 32. What is the correct syntax for including a user-defined header file in C++ ?
Ans. #include "filename"
Q 33. What is correct about the static data member of a class ?
Ans. A static member function can access only static data members of a class and a static data member is shared among all the object of the class.
Q 34. What syntax used to write a comment in C++?
Ans. // comment 1 Or /* comment 2 */
Q 35. Static variable in a class is initialized when______ ?
Ans. When first object of the class is created.
Q 36. What access specifier is used as a default in a class definition ?
Ans. Private
Q 37. How many C++ data types are broadly classified ?
Ans. 3
Free Mock Test
Follow us on Facebook