Programming In C++ (3330702) MCQs

MCQs of Managing Console I/O Operations

Showing 1 to 10 out of 18 Questions
1.

 To perform File I/O operations, we must use _____________ header file.

 

File I/O operations કરવા માટે, આપણે _____________ હેડર ફાઇલનો ઉપયોગ કરવો જરૂરી છે.

 

(a)

<ifstream>

 

(b)

<ofstream>

 

(c)

<fstream>

 

(d)

Any of these

 

Answer:

Option (c)

2.

To create an output stream, we must declare the stream to be of class ___________ .

 

output stream બનાવવા માટે, આપણે stream ને ___________ class માં declare કરવી જોઈએ.

 

(a)

ofstream

 

(b)

ifstream

 

(c)

iostream

 

(d)

iofstream

 

Answer:

Option (a)

3.

Predict the output

int x = 786;

cout << setfill(‘*’) << setw(6) << x;"

 

output બતાવો

int x = 786;

cout << setfill(‘*’) << setw(6) << x;"

 

(a)

786***

 

(b)

 **786

 

(c)

***786

 

(d)

******

 

Answer:

Option (c)

4.

  ___________ header file is used for manipulators.

___________ હેડર ફાઇલનો ઉપયોગ મેનિપ્યુલેટર માટે થાય છે.

 

(a)

<iomanipulator.h>

 

(b)

 <stdiomanip.h>

 

(c)

<stdmanip.h>

 

(d)

<iomanip.h>

 

Answer:

Option (d)

5.

Which operator is used to insert the data into file?

ફાઇલમાં ડેટા insert કરવા માટે કયા ઓપરેટરનો ઉપયોગ થાય છે?

 

(a)

>>

 

(b)

<<

 

(c)

<

 

(d)

 >

 

Answer:

Option (b)

6.

Which header file is used for reading and writing to a file?

 

ફાઇલમાં reading અને writing માટે કઈ હેડર ફાઇલનો ઉપયોગ થાય છે?

 

(a)

#include<iostream>

 

(b)

 #include<fstream>

 

(c)

#include<file>

 

(d)

#include<fe>

 

Answer:

Option (b)

7.

Which operator is used for input stream?

 

ઇનપુટ સ્ટ્રીમ માટે કયા operator નો ઉપયોગ થાય છે?

 

(a)

 >

 

(b)

 >>

 

(c)

<<<

 

(d)

>>>

 

Answer:

Option (b)

8.

Pick out the correct objects about the instantiation of output stream.

 

output stream ના instantiation વિશે યોગ્ય objects પસંદ કરો.

 

(a)

 cout

 

(b)

cerr

 

(c)

clog

 

(d)

all of the mentioned

 

Answer:

Option (d)

9.

What will be the output of the following C++ code?

#include <iostream>

    using namespace std;

    int main () 

    {

        char str[] = ""Steve jobs"";

        int val = 65;

        char ch = 'A';

        cout.width (5);

        cout << right;

        cout << val << endl;

        return 0;

    }

 

નીચે આપેલા c++ code નું output શું થશે?

#include <iostream>

    using namespace std;

    int main () 

    {

        char str[] = ""Steve jobs"";

        int val = 65;

        char ch = 'A';

        cout.width (5);

        cout << right;

        cout << val << endl;

        return 0;

    }

 

(a)

Steve jobs

 

(b)

A

 

(c)

65

 

(d)

      65

 

Answer:

Option (d)

10.

How many types of output stream classes are there in c++?

c++ માં કેટલા પ્રકારનાં આઉટપુટ સ્ટ્રીમ classes છે?

 

(a)

1

(b)

2

(c)

3

(d)

4

Answer:

Option (c)

Showing 1 to 10 out of 18 Questions