C++ MCQ -5

Question 1

Streams are

a.       Abstraction to perform input and output operations in sequential media

b.      Abstraction to perform input and output operations in direct access media

c.       Objects  where a program can either insert or extract characters to and from it

d.      Both a and c

 
Question 2

Which of the following is known as insertion operator?

a.       ^

b.      v

c.       <<

d.      >>

 

 
Question 3:

Regarding the use of  new line character (/n) and endl manipulator with cout statement

a.       Both ways are exactly same

b.      Both are similar but endl additionally performs flushing of buffer

c.       endl canΓÇÖt be used with cout

d.      \n canΓÇÖt be used with cout

 
Question 4:

Which of the following is output statement in C++?

a.       print

b.      write

c.       cout

d.      cin

 
Question 5:

Which of the following is input statement in C++?

a.       cin

b.      input

c.       get

d.      none of above

 
Question 6:

By default, the standard output device for C++ programs is

a.       Printer

b.      Monitor

c.       Modem

d.      Disk

 
Question 7:

By default, the standard input device for C++ program is

a.       Keyboard

b.      Mouse

c.       Scanner

d.      None of these

 
Question 8:

Which of the following statement is true regarding cin statement?

a.       cin statement must contain a variable preceded by >> operator

b.      cin does not process the input until user presses RETURN key

c.       you can use more than one datum input from user by using cin

d.      all of above

Question 9:

Which of the following is extraction operator in C++?

a.       ^

b.      v

c.       <<

d.      >>

 
Question 10:

When requesting multiple datum, user must separate each by using

a.       a space

b.      a tab character

c.       a new line character

d.      all of above

1.       d. Both a and c

2.       c. <<

3.       b. Both are similar but endl additionally performs flushing of buffer

4.       c. Cout

5.       a. Cin

6.       b. Monitor

7.       a. Keyboard

8.       d. All of above

9.       d. >>

10.   d. all of above

Similar Posts

  • C++ MCQ-12

    Q.1   The address of a variable temp of type float is          (A) *temp  (B) &temp     (C) float& temp  (D) float temp&     Ans: B   Q.2   What is the output of the following code           char symbol[3]={ΓÇÿaΓÇÖ,ΓÇÿbΓÇÖ,ΓÇÿcΓÇÖ};            for (int index=0; index<3; index++)         cout << symbol…

  • C++ MCQ-11

    Q.31  Use of virtual functions implies (A)  overloading.  (B)  overriding. (C)  static binding.  (D)  dynamic binding. Ans: D   Q.32   this pointer      (A)  implicitly points to an object.    (B)  can be explicitly used in a class. (C)  can be used to return an object.   (D)  All of the above.    Ans: D…

  • C++ MCQ-10

    Q.16   If we create a file by ΓÇÿifstreamΓÇÖ, then the default mode of the file is _________    (A)  ios :: out  (B)  ios :: in (C)  ios :: app  (D)  ios :: binary     Ans: B   Q.17   A variable defined within a block is visible        (A) from the point of…

  • C++ MCQ-15

    Q.76   Which of the following expressions is illegal? (A)  ( ) 6 10 .  (B)  (false && true) (C)  bool (x) = (bool)10;  (D)  float y = 12.67;       Ans:C   Q.77  The actual source code for implementing a template function is created when   (A) The declaration of function appears. (B) The…

  • C++ MCQ -7

    Question 1 A variable is/are a.    String that varies during program execution b.    A portion of memory to store a determined value c.    Those numbers that are frequently required in programs d.    None of these   Question 2 Which of the following can not be used as identifiers? a.    Letters b.    Digits c.    Underscores d.   …

Leave a Reply

Your email address will not be published. Required fields are marked *