Home
Current Affairs January 2024

What is the correct answer?

4

You can read input that consists of multiple lines of text using

A. The normal cout<< combination

B. The cin.get() function with one argument

C. The cin.get() function with two argument

D. The cin.get() function with three argument

Correct Answer :

C. The cin.get() function with two argument


Related Questions

What is the correct answer?

4

Protected members cannot be inherited.

A. True

B. False

What is the correct answer?

4

In C++, identifiers have to be declared at the beginning of the blocks.

A. True

B. False

What is the correct answer?

4

By default, members cannot be inherited.

A. True

B. False

What is the correct answer?

4

What is the output of the following program segment - for(i = 1, j = 0; i < 10; i++) j += i; cout <<i<<"
";

A. 10

B. 20

C. 55

D. there is an error in the program

What is the correct answer?

4

Sharing of common information are achieved by the concept of

A. Virtual copying

B. Inheritance

C. Encapsulation

D. None of these

What is the correct answer?

4

The && and || operators

A. Compare two numeric values

B. Combine two numeric values

C. Compare two Boolean values

D. Combine two Boolean values

What is the correct answer?

4

Class is similar to a variable.

A. True

B. False

What is the correct answer?

4

A function that is called automatically when an object is created is known as

A. instantiation

B. function prototype

C. constructor

D. structure

What is the correct answer?

4

If a friend function is declared inside a class it can access all data members of the class.

A. True

B. False

What is the correct answer?

4

Overloaded functions

A. Are a group of functions with the same name

B. All have the same number and types of arguments

C. Make life simpler for programmer

D. May fail unexpectedly due to stress

What is the correct answer?

4

cc ___________ option is used only to create object file

A. -a

B. -o

C. -c

D. none of these

What is the correct answer?

4

An object is an allocated space in memory.

A. True

B. False

What is the correct answer?

4

In a class, only the member function can access data, which is not accessible to outside. This feature is called:

A. Data security

B. Data hiding

C. Data manipulation

D. Data definition

What is the correct answer?

4

The declaration int **var1; shows that

A. var1 can not be accessed

B. var1 is a pointer to a pointer of type int

C. var1 is a protected data type of integer

D. this type declaration shows an error

What is the correct answer?

4

In case of nested class, enclosing class can directly access the private data member of nested class.

A. True

B. False

What is the correct answer?

4

Static member functions have file scope.

A. True

B. False

What is the correct answer?

4

Objects get destroyed in the reverse order as they are created.

A. True

B. False

What is the correct answer?

4

Protected data members can be accessed

A. Only from the base class itself

B. Both form the base class and from its derived classes

C. From the class which is friend of the base class

D. None of the above are correct

What is the correct answer?

4

Which of the following is true about const member functions?

A. const members can be invoked on both const as well as nonconst objects

B. const members can be invoked only on const objects and not on nonconst objects

C. nonconst members can be invoked on const objects as well as nonconst objects

D. none of the above

What is the correct answer?

4

ios containes a pointer to streambuf.

A. True

B. False

What is the correct answer?

4

When you overload an arithmetic assignment operator, the result

A. Goes in the object to the right of the operator

B. Goes in the object to the left of the operator

C. Goes in the object of which the operator is a member

D. Must be returned

What is the correct answer?

4

The scope resolution operator is -

A. ::

B. ;

C. <<

D. ->

What is the correct answer?

4

The members of a class can be made private by

A. declaring them private

B. by default they are private

C. by declaring them in the beginning of the program immediately after main()

D. they are always public

What is the correct answer?

4

A variable defined within a block is visible

A. From the point of definition onwards in the program

B. From the point of definition onwards in the function

C. From the point of definition onwards in the block

D. Throughout the function

What is the correct answer?

4

Class members are _______________ by default

A. Private

B. protected

C. public

D. None of the above are correct

What is the correct answer?

4

Member function cannot be called from within a constructor.

A. True

B. False

What is the correct answer?

4

Dynamic memory can be allocated by the following declaration

A. new

B. volatile

C. static

D. ==

What is the correct answer?

4

Delete operator is used

A. To allocate storage

B. To deallocate storage

C. To delete variable name

D. None of the above are correct

What is the correct answer?

4

In C++, the exception handler is invoked with a-

A. try block

B. throw exception

C. catch function

D. abort()

What is the correct answer?

4

When accessing a structure member, the identifier to the left of the dot operator is the name of

A. Structure member

B. Structure tag

C. Structure variable

D. The keyword struct.