Programming MCQs

MCQ On C++ Tokens, Expressions And Control Structure Part-2

Pinterest LinkedIn Tumblr
Here are the collections of MCQ 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 typecast operators. It also includes type cast operators 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

Read Also: MCQ On C++ Tokens, Expressions And Control Structure Part-1

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) +=

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

Please follow and like us:
RSS
Follow by Email
X (Twitter)
Visit Us
Follow Me
YouTube
YouTube
LinkedIn
linkedIn | MCQ On C++ Tokens, Expressions And Control Structure Part-2
Share

Author

Shuseel Baral is a web programmer and the founder of InfoTechSite has over 8 years of experience in software development, internet, SEO, blogging and marketing digital products and services is passionate about exceeding your expectations.

Comments are closed.

RSS
Follow by Email
X (Twitter)
Visit Us
Follow Me
YouTube
YouTube
LinkedIn
Share