⚙️ C++ Programming MCQs and Exam Questions

Practice 184 approved ⚙️ C++ Programming MCQs and exam questions from the 💻 Programming subject.

184 solved MCQs

Which of the following statement is correct?Answer: Both A and B. Which of the following statements are correct?Answer: Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly. How many times a constructor is called in the life-time of an object?Answer: Only once Which of the following gets called when an object is being created?Answer: constructor To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .Answer: delete[] Which of the following statement is correct about constructors?Answer: A constructor has no return type. Which of the following statement is correct whenever an object goes out of scope?Answer: The default destructor of the object is called. ____ is called a C++ instruction that tells the computer to do something.Answer: statement Function overloading is an example of _____?Answer: Polymorphism The most common used data types in C++ is/are ___ :Answer: All of these In order to use a variable in C++, we ____________ first declare it.Answer: Must Which type of function is not a member of a class, but can access its private members?Answer: Friend The strcpy() functions argument are :Answer: 2 parameters Which of following ASP, Net Object encapsulates the state of the client ?Answer: Session object If the instructions are written in binary language then it is called ___________Answer: Machine language The idea behind limiting the lifetime of variables is to save:Answer: Memory space Member functions in C++ are called:Answer: Functions Being able to _________ your own types is called extensibility.Answer: Create There are ___________ kinds of casts in standard C++.Answer: 2 __________ declarations are also called prototypes, since they provide a model or blueprint for the function.Answer: Function An overloaded function is actually a group of ___________ with the same name.Answer: Functions In C++, 'b' escape sequence is used for:Answer: Backspace A high level language is much powerful programming tool than _________ language.Answer: Assembly Language ____________ function is the point by where all C ++ programs start their execution.Answer: Main _________ are those words which have their special meaning within the C++ language.Answer: Both A & B Which of the following is a high-level programming language?Answer: Both B&C Which of the following is the Preprocessor Directive in C++?Answer: #include Which of the following is an Implementation of dynamic arrays in C ++? List, ArrayList, Vector, None of theseAnswer: Vector In order to use a variable in C++ we ___ first declare it?Answer: Must Which of the following are the types of loops in C++?Answer: For, While, Do-While