- 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.
Q 1 - The default access specifer for the class members is
Answer : B
Explaination
If a member/s appear in the class with following no access specifier, the default is private.
Q 2 - The operator used to access member function of a structure using its object.
Answer : A
Explaination
Just the way we use dot (.) operator to access members of the class, in similar it is used to access the members of the structure too.
Q 3 - Pick up the valid declaration for overloading ++ in postfix form where T is the class name.
Answer : B
Explaination
The parameter int is just to signify that it is the postfix form overloaded. Shouldn’t return reference as per its original behavior.
Q 4 - Designer of C++ programming language.
Answer : D
Explaination
Q 5 - The programs machine instructions are store in __ memory segment.
Answer : D
Explaination
Code segments holds the program instructions and fetched by instruction pointer for execution.
Q 6 - A C++ program statements can be commented using
Answer : D
Explaination
Both styles of commenting is available in C++.
Q 7 - An exception is __
Answer : A
Explaination
When the program is in execution phase the possible unavoidable error is called as an exception.
Q 8 - What is the output of the following program?
#include<iostream> using namespace std; void swap(int m, int n) { int x = m; m = n; n = x; } main() { int x = 5, y = 3; swap(x,y); cout<<x<<" "<<y; }
Answer : B
Explaination
5 3, call by value mechanism can’t alter actual arguments.
#include<iostream> using namespace std; void swap(int m, int n) { int x = m; m = n; n = x; } main() { int x = 5, y = 3; swap(x,y); cout<<x<<" "<<y; }
Answer : B
Explaination
g++ is GNU C++ compiler for linux. Borland and vc++ (Microsoft visual c++) for windows.
Q 10 - i) Exceptions can be traced and controlled using conditional statements.
ii) For critical exceptions compiler provides the handler
Answer : B
Explaination
Conditional statements are used to take alternate actions depending upon certain condition but not multi branching. C++ too provides some critical exception handlers.
To Continue Learning Please Login
Login with Google