Explore topic-wise MCQs in C++ Programming.

This section includes 3 Mcqs, each offering curated multiple-choice questions to sharpen your C++ Programming knowledge and support exam preparation. Choose a topic below to get started.

1.

Which keyword is used to represent a friend function?

A. friend
B. Friend
C. friend_func
D. Friend_func
Answer» B. Friend
2.

Which of the following is correct about friend functions?

A. Friend functions use the dot operator to access members of a class using class objects
B. Friend functions can be private or public
C. Friend cannot access the members of the class directly
D. All of the mentioned
Answer» E.
3.

What is a friend function in C++?

A. A function which can access all the private, protected and public members of a class
B. A function which is not allowed to access any member of any class
C. A function which is allowed to access public and protected members of a class
D. A function which is allowed to access only public members of a class
Answer» B. A function which is not allowed to access any member of any class