C++ Online Test | Questions and Answers for Gate 2020-2021 - 2

Question: 6

Which of the following are good reasons to use an object oriented language?

(A) An object oriented program can be taught to correct its own errors

(B) Program statements are simpler than in procedural language

(C) We can define our own data types

(D) None of these

Ans: C

We can define our own data types

Question: 7

In a class specified, data or functions and designated private are accessible

(A) Only to public members of class

(B) Only if you know the password

(C) To any function in the program

(D) To member functions of that class

Ans: D

To member functions of that class

Question: 8

When a language has the capability to produce new data types, it is called

(A) Extensible

(B) Encapsulated

(C) Reprehensible

(D) None of these

Ans: D

None of these

Question: 9

Keyword typed is used to declare

(A) A synonym for an existing type

(B) Absence of a type

(C) Objects that can be modified outside of a program control

(D) A member function that is defined in a subclass

Ans: A

A synonym for an existing type

Question: 10

In C++ programming language, to write data that contains variables of type flat to an object of type of stream, which of the following should be used?

(A) Put ( )

(B) Seekg ( )

(C) Write ( )

(D) Insertion operator

Ans: C

Write ( )

Related Questions