0% found this document useful (0 votes)
4 views2 pages

C++ Q paper with answer

The document consists of a series of multiple-choice questions related to C++ programming concepts, including object-oriented programming, data types, constructors, operators, and loops. It covers fundamental topics such as the scope resolution operator, storage classes, and the characteristics of classes and functions. The questions are designed to assess knowledge of C++ syntax and principles.

Uploaded by

mediaac2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

C++ Q paper with answer

The document consists of a series of multiple-choice questions related to C++ programming concepts, including object-oriented programming, data types, constructors, operators, and loops. It covers fundamental topics such as the scope resolution operator, storage classes, and the characteristics of classes and functions. The questions are designed to assess knowledge of C++ syntax and principles.

Uploaded by

mediaac2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Name ______________________________________________ MEDIA

COMPUTER EDUCATION

Batch _______________ Date ______ /_______ /__________ Marks Scored:

C++
1. What is an object in c++?
It is function of class It is instance of class
It is datatype of class It is part of the syntax of class
2. Identify the incorrect constructor type.
Friend constructor Default constructor
Parameterized constructor Copy constructor
3. Identify the logical AND operator.
|| &&
& !
4. Identify the scope resolution operator.
: ::
? None
5. Identify the size of int datatype in C++.
1 byte 2 bytes
4 bytes Depends on compiler
6. Identify the storage classes that have global visibility.
Extern auto
Register static
7. Size of structure is.
2 4
2 or 4 Depends on number of bits in system
8. The constants in C++ are also known as?
pre-processor literals
const none
9. Total types of constructors in C++ are?
1 2
3 4
10. Total types of errors in C++.
1 2
3 4
11. Under which pillar of OOPS does base class and derived class relationship come?
Polymorphism Inheritance
Encapsulation Abstraction
12. Using which of the following data type can 19.54 be represented?
Void double
Int None
13. Using which of the following keywords can an exception be generated?
Threw throws
Throw catch
14. What does a C++ class hold?
Function Data
Arrays Both a and b
15. Identify the format specifier among the following.
& \n
%d None
16. What is do-while loop also known as?
Exit control Entry control
Per tested All of the above
17. What is the ASCII value of ‘\0’ character?
32 24
48 0
18. What is the number of parameters that a default constructor requires?
0 1
2 3
19. When can an inline function be expanded?
Runtime Compile time
Never gets expanded All of the above
20. Which of the following data type is supported in C++ but not in C?
Int bool
Double float
21. Which of the following functions can be inherited from base class?
Constructor Destructor
Static None
22. Which of the following is not a type of inheritance?
Multiple Multilevel
Distributed Heirarchical
23. Which of the following is the correct identifier?
2var_name 2VAR_NAME
$varname var_name12
24. Which of the following is “address of operator”?.
* &
[] &&
25. Which of the following loops is best when we know the number of iterations?
While loop Do while
For loop All of the above
26. Which of the following types is the language C++?
Procedural Statically typed language
Dynamically typed language All of the above
27. Why are comments used?
Make the program run faster To help others read & understand the program
Increase the size of the executable program Make a program compile easier
28. C++ uses which approach?
right -left Top-down
left-right bottom -up
29. Choose the correct default return value of function.
Int void
Char float
30. Choose the correct option which is mandatory in a function.
return_type parameters
function_name Both a and c
31. Choose the correct subscript operator.
[] {}
* ()
32. Choose the option below which is not a member of class.
Friend function Static function
Virtual function Const function
33. Choose the size of the below struct.
Struct{
Int a;
Char b;
Float c;
}
2 4
7 10
34. Choose the type of loop which is guaranteed to execute at-least once?
for loop do-while
while None
35. Data members and member functions of a class are private by.default. True or False?
True False
Depends on code None

You might also like