0% found this document useful (0 votes)
124 views

C++ Question Answers

The document contains 20 multiple choice questions about various operators, expressions, and control structures in C++. The questions cover topics like operator overloading, scope resolution operator (::), pointer-to-member operator (::*), new and delete operators, relational, logical, and bitwise expressions, for, while, do-while, and switch control structures, and compound assignment operators.

Uploaded by

yeshwant patil
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)
124 views

C++ Question Answers

The document contains 20 multiple choice questions about various operators, expressions, and control structures in C++. The questions cover topics like operator overloading, scope resolution operator (::), pointer-to-member operator (::*), new and delete operators, relational, logical, and bitwise expressions, for, while, do-while, and switch control structures, and compound assignment operators.

Uploaded by

yeshwant patil
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

1.

In C++, we can give several meanings to an operator, depending upon the types of arguments used, which was
known as …………..

A) Operator variable B) Operator overloading C) Operator loading D) Operator manipulation

2. Which of the following is/are the pointer-to-member operator used in C++.

i) : : ii) : : * iii) _>* iv) . *

A) i and ii only B) ii and iiii only C) i and iv only D) iii and iv only

3. Which of the following is the scope resolution operator in C++.

A) : : B) : : * C) _>* D) . *

4. …………….. operator can be used to uncover a hidden variable.

A) pointer-to-member B) memory release C) scope resolution D) line feed

5. A major application of the ………………… operator is in the classes to identify the class to which a member function
belongs.

A) pointer-to-member B) memory release C) scope resolution D) line feed

6. ……………….. operator is used to access a member using a pointer to the object and a pointer to that member.

A) : : B) : : * C) _>* D) . *

7. ………………. operator is used to declare a pointer to a member of a class.

A) : : B) : : * C) _>* D) . *

8. The ………………. operator allocates sufficient memory to hold a data object type data type and returns the address of
the object.

A) malloc() B) calloc() C) new D) free()

9. The expression …………….. will delete the entire array pointed to by p.

A) delete all p; B) delete array p; C) delete * p; D) delete[ ] p;

10. The ……………… operator automatically returns the correct pointer type, so that there is no need to use a type cast.

A) new B) delete C) malloc() D) setw

11. The …………….. manipulator is used in an output statement which causes a linefeed to be inserted.

A) setw B) delete C) endl D) symbol

12. Which of the following is/are the new cast operators used in C++.

i) const_cast ii) static_cast iii) dynamic_cast iv) new_cast

A) i, ii and iii only B) ii, iii and iv only C) i, iii and iv only D) All i, ii, iii and iv

13. A/An …………………. is a combination of operator, constants and variables arranged as per the rules of the language.

A) token B) expression C) structure D) none


14. Which of the following is/are the types of C++ expressions.

i) constant expressions ii) integral expressions iii) float expressions iv) null expressions

A) i, ii and iii only B) ii, iii and iv only C) i, iii and iv only D) All i, ii, iii and iv

15. ……………………. produce results of type bool which takes a value true or false.

A) Relational expressions B) Float expressions C) Logical expressions D) Bitwise expressions

16. ……………… combine to or more relational expressions and produces bool type results.

A) Relational expressions B) Float expressions C) Logical expressions D) Bitwise expressions

17. The ………………… is an entry-enrolled loop and is used when an action is to be repeated for a predetermined
number of times.

A) while B) for C) do-while D) switch

18. The ………………….. is an exit-enrolled loop where the control is transferred back to a particular point in the program.

A) while B) for C) do-while D) switch

19. The ………………… is a multiple-branching statement where, based on a condition, the control is transferred to one
of the many possible points.

A) while B) for C) do-while D) switch

20. The operator ………………… is known as a compound assignment or short-hand assignment operator.

A) = B) = = C) += = D) +=

You might also like