Paper Tayyari

Lecture 36: Stream Manipulation

MCQs, short and long questions from lecture 36.Lecture 36 ki MCQs, short aur long sawal.

8 MCQs · 2 short · 2 long questions · 8 MCQs from past papers8 MCQs · 2 short · 2 long sawal · 8 MCQs past papers se

Start mock testMock test shuru karein
DoneHal kiye 0/8
– correctsahi
1.
★ Final term 2017 (paper 1)

Both endl and flush are ________.

  1. AFunctions
  2. BOperators
  3. CManipulators
  4. DObjects

endl and flush are stream manipulators that act on the output stream.

2.
★ Final term 2017 (paper 1)

What will be the output of the following statement? cout << setbase(16) << 52 ;

  1. A52
  2. B34
  3. C64
  4. D32

setbase(16) prints in hexadecimal and 52 decimal is 0x34.

3.
★ Final term 2017 (paper 4)

Which header file should be included in the program to use stream manipulators?

  1. Aiostream.h
  2. Bstdlib.h
  3. Cstdio.h
  4. Diomanip.h

Parameterized manipulators such as setw and setprecision are declared in iomanip.h.

4.
★ Final term solved MCQs (Moaaz & Asad)

width() is member function of _____________

  1. Acin object
  2. Bcout object
  3. CBoth cin and cout object
  4. DNone of the given option

width() is a member of the ios base class, so both input and output streams have it.

5.
★ Final term solved MCQs (Moaaz & Asad)

When we use manipulators in our program then which header file should be included?

  1. Aiostream.h
  2. Bstdlib.h
  3. Cstdio.h
  4. Diomanip.h

Parameterized manipulators are declared in iomanip.h.

6.
★ Final term solved MCQs (Moaaz & Asad)

setprecision is a parameter less manipulator.

  1. ATrue
  2. BFalse

setprecision takes an argument, so it is a parameterized manipulator.

7.
★ Final term solved MCQs (Moaaz & Asad)

setw is a parameterized manipulator.

  1. ATrue
  2. BFalse

setw takes a width argument.

8.
★ Final term solved MCQs (Moaaz & Asad)

dec, hex, oct are all __________

  1. AMember functions
  2. BObjects of input/output streams
  3. CParameterized manipulators
  4. DNon-parameterized manipulators

dec, hex and oct take no arguments.