MCQ On C++ Tokens Expressions And Control Sturcture Part-2

Here are the collections of top 20 multiple choice questions on C++ tokens, expressions and control structure includes MCQ on different types of operators, scope resolution operator, member dereferencing operators and memory management operators along with C++ manipulators and type cast operators. It also includes about type cast operator and their types and control structures.

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 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 compound assignment or short-hand assignment operator.
A) =
B) = =
C) += =
D) +=

Answers

1. B) Operator overloading
2. D) iii and iv only
3. A) : :
4. C) scope resolution
5. C) scope resolution
6. C) _>*
7. B) : : *
8. C) new
9. D) delete[ ] p;
10. A) new
11. C) endl
12  A) i, ii and iii only
13. B) expression
14. A) i, ii and iii only
15. A) Relational expressions
16. C) Logical expressions
17. B) for
18. C) do-while
19. D) switch
20. D) +=

Read Next:Top 20 MCQ Questions On C++ Classes And Objects

Read More:C and C++ MCQ Questions


MCQ On C++ Tokens Expressions And Control Sturcture Part-2
2017-04-30T07:49:00-07:00
Shuseel Baral
C & CPP|Multiple Choice Question (MCQ)|