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 -8

    Question 1 Identify the correct statement a. Programmer can use comments to include short explanations within the source code itself. b. All lines beginning with two slash signs are considered comments. c. Comments very important effect on the behaviour of the program d. both   Question 2 The directives for the preprocessors begin with a.   …

  • 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.   …

  • C++ MCQ -3

    Question 1: Find out the error in following block of code. If (x = 100)     Cout << ΓÇ£x is 100ΓÇ¥; a.       100 should be enclosed in quotations b.      There is no semicolon at the end of first line c.       Equals to operator mistake d.      Variable x should not be inside quotation   Question 2:…

  • C++ MCQ -4

    Question 1:   cin extraction stops execution as soon as it finds any blank space character   a.       true b.      false   Question 2:   Observe the following statements and decide what do they do.   string mystring;   getline(cin, mystring);   a.       reads a line of string from cin into mystring b.      reads a…

  • C++ MCQ -9

    Question 1: A function can not be overloaded only by its return type. a. True b. False   Question 2: A function can be overloaded with a different return type if it has all the parameters same. a. True b. False   Question 3: Inline functions involves some additional overhead in running time. a. True…

Leave a Reply

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