- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
- C++ Advanced
- C++ Files and Streams
- C++ Exception Handling
- C++ Dynamic Memory
- C++ Namespaces
- C++ Templates
- C++ Preprocessor
- C++ Signal Handling
- C++ Multithreading
- C++ Web Programming
C++ Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to C++ Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Answer : B
Explaination
The purpose of the constructor cannot be overridden in the derived class hence constructor cannot be a virtual.
Q 2 - Which operator is required to be overloaded as member function only?
Answer : D
Explaination
Overloaded assignment operator does the job similar to copy constructor and is required to be overloaded as member function of the class.
Q 3 - Which is the storage specifier used to modify the member variable even though the class object is a constant object?
Answer : D
Explaination
mutable is storage specifier introduced in C++ which is not available in C. A class member declared with mutable is modifiable though the object is constant.
Q 4 - The pointer which stores always the current active object address is __
Answer : B
Explaination
this is the keyword and acts as a pointer which always holds current active objects.
Q 5 - What is the full form of RTTI.
A - Runtime type identification
B - Runtime template identification
Answer : A
Explaination
Q 6 - (i) ‘ios’ is the base class of ‘istream’
(ii) All the files are classified into only 2 types. (1) Text Files (2) Binary Files.
Answer : C
Explaination
Q 7 - What is the output of the following program?
#include<iostream> using namespace std; main() { char s[] = "hello", t[] = "hello"; if(s==t) cout<<"eqaul strings"; }
Answer : C
Explaination
No output, as we are comparing both base addresses and are not same.
#include<iostream> using namespace std; main() { char s[] = "hello", t[] = "hello"; if(s==t) cout<<"eqaul strings"; }
Answer : D
Explaination
The size of ‘int’ depends upon the complier i.e. whether it is a 16 bit or 32 bit.
Answer : B
Explaination
g++ is GNU C++ compiler for linux. Borland and vc++ (Microsoft visual c++) for windows.
Q 10 - What is the output of the following program?
#include<iostream> using namespace std; main() { class student { int rno = 10; } v; cout<<v.rno; }
Answer : D
Explaination
Class member variables cannot be initialized.
#include<iostream> using namespace std; main() { class student { int rno = 10; } v; cout<<v.rno; }
To Continue Learning Please Login
Login with Google