C++ Language Interview Questions for Experienced Pdf - 2

Question: 6

What is the use of Input stream?

Cin is a predefined object that corresponds to a standard input stream.

Input stream represents the flow of data from the standard input device – the keyboard.

Question: 7

What is the use of cin object?

Data is read from the keyboard during runtime by using the object cin.

Question: 8

When are the variables to be declared?

Declaration statement variables need to be declared and defined before they are used in a program.

Declaration of a variable introduces a variable’s name and its associated data type.

Question: 9

What are loops?

Loops execute a set of instructions repeatedly for a certain number of times.

Question: 10

What is nested loop and what are the rules for the formation of nested loops?

It is possible to nest loop construct inside the body of another.

The rules for the formation of nested loops are:

An outer loop and inner loop cannot have the same control variable, as it will lead to logical errors.

The inner loop must be completely nested inside the body of the outer loop.

Related Questions