Examveda

Which of the following is the insertion operator?

A. >>

B. <<

C. //

D. /*

E. both (a) and (b)

Answer: Option B

Solution (By Examveda Team)

The insertion operator in C++ is used to insert data into an output stream, such as cout.

Option A: >> - This is the extraction operator, used to extract data from an input stream, such as cin.

Option B: << - This is the insertion operator, used to insert data into an output stream, such as cout.

Option C: // - This denotes a single-line comment in C++.

Option D: / - This denotes the beginning of a multi-line comment in C++, which ends with /.

Option E: both (a) and (b) - This is incorrect because only Option B: << is the insertion operator.

Therefore, the correct answer is Option B: <<.

Join The Discussion

Comments (1)

  1. The Best
    The Best:
    7 years ago

    i think the answer is A, because B is extraction operator

Related Questions on Object Oriented Programming Using C Plus Plus

A default catch block catches

A. all thrown objects

B. no thrown objects

C. any thrown object that has not been caught by an earlier catch block

D. all thrown objects that have been caught by an earlier catch block