C/C++ Quiz

Create an engaging image depicting C++ programming concepts, including code snippets, exception handling, and object-oriented programming elements.

C/C++ Programming Quiz

Test your knowledge of C and C++ programming with this comprehensive quiz! This quiz consists of 25 multiple-choice questions designed to challenge your understanding of key concepts.

Whether you are a student, professional, or just a programming enthusiast, this quiz is perfect for those looking to evaluate their skills and learn new information. Topics covered include:

  • Exceptions and Error Handling
  • Object-Oriented Programming
  • Memory Management
  • Function Templates
  • Operator Overloading
25 Questions6 MinutesCreated by CodingWizard342
Functions called from within a try block may also throw exception.
True
False
A class can contain objects of other classes and this phenomenon is called_________ .
Relationship
Object Association
Containership
None of these
If a class contains pure virtual function, then it is termed as____________________ .
Virtual Class
Sealed Class
Abstract Class
Pure local class
Generic catch handler is represented by ______________ .
Catch(..,)
Catch(...)
Catch(---)
Catch(void x)
Which one is suitable syntax for function template?
A.) template< class T> return_type Function_Name(parameters)
B.) template< typename T> return_type Function_Name(parameters)
Both a and b
None of these
By default, all the files are opened in ___________mode .
Text
Binary
In CPP, cin and cout are the predefined stream __________ .
Operators
Functions
Objects
Data types
Constant variables can be created in CPP by using ________
Const
Enum
#define
All of these
None of these
The code of statements which may cause abnormal termination of the program should be written under_________ block.
Try
Catch
Finally
None of these
Object based language differs from object oriented language as it does not support features _____ .
 
1. Encapsulation 
2. Inheritance 
3. Dynamic Binding 
4. Abstraction
5. Polymorphism
Only 3,4
Only 1,3,5
Only 2,4,5
Only 2,3
In CPP, dynamic memory allocation is done using ______________ operator.
Calloc()
Malloc()
New
Allocate
Which of the following is not a casting operator in CPP?
Static_cast
Explicit_cast
Dynamic_cast
Reinterpret_cast
___________ header file is used for manipulators.
< iomanipulator.h>
< stdmanipulator.h>
< iomanip.h>
< stdmanip.h>
In a program, If there exists a function template with two parameters and normal function say void add(int , int), so add(3,4) will _____________________ .
Invoke function template body as it is generic one
Invokes normal function as it exactly matches with its prototype
Not be called and Compiler issues warning
Not be called and Compiler issues ambiguity in calling add()
In case of operator overloading, operator function must be ______ . 

1. Static member functions
2. Non- static member functions
3. Friend Functions
Only 2
Only 1,3
Only 2,3
All of these
Only functions of the class can access the data of the class and they(functions) provides the interface between data, objects and the program. This kind isolation of the data from direct access by the program is called _______________ .
Data Abstraction
Data Binding
Data Hiding
Data Encapsulation
Syntax for Pure Virtual Function is ______________ .
Virtual void show()==0
Void virtual show()==0
Virtual void show()=0
Void virtual show()=0
Logical expressions produce ____________ type results.
Explicit
Garbage
Bool
Static
A friend function does not have 'this' pointer associated with it.
True
False
When a class is defined inside any function or block, it is called ___________
Nested
Block
Local
Not possible
If an argument to a function is declared as const, then _______ .
Function can modify the argument
Function can't modify the argument
Cost argument to a function is not possible
None of these
Can we write throw clause inside catch handler?
Yes
No
Predict the output:

float x= 3.1496;
cout << setpricision(2) << x;
3.14
3.15
3.00
None of these
Static variable must be declared in public section of the class.
True
False
Class X, class Y and class Z are derived from class BASE. This is ______ inheritance.
Multiple
Multilevel
Hierarchical
Singular
{"name":"C\/C++ Quiz", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge of C and C++ programming with this comprehensive quiz! This quiz consists of 25 multiple-choice questions designed to challenge your understanding of key concepts.Whether you are a student, professional, or just a programming enthusiast, this quiz is perfect for those looking to evaluate their skills and learn new information. Topics covered include:Exceptions and Error HandlingObject-Oriented ProgrammingMemory ManagementFunction TemplatesOperator Overloading","img":"https:/images/course5.png"}
Powered by: Quiz Maker