Programming In C++ (3330702) MCQs

MCQs of Managing Console I/O Operations

Showing 11 to 18 out of 18 Questions
11.

What must be specified when we construct an object of class ostream?

 

જ્યારે આપણે class ostream નું object બનાવી એ ત્યારે શું specified કરવું જોઈએ?

 

(a)

stream

 

(b)

streambuf

 

(c)

memory

 

(d)

steamostream

 

Answer:

Option (b)

12.

Where does a cin stops it extraction of data?

 

cin તેને ડેટા extraction ક્યાં થી stop થાય છે?

 

(a)

By seeing a blank space

 

(b)

By seeing (

 

(c)

By seeing a blank space & (

 

(d)

By seeing <

 

Answer:

Option (a)

13.

Which is used to get the input during runtime?

 

રનટાઇમ દરમિયાન ઇનપુટ મેળવવા માટે શું વપરાય છે?

 

(a)

cout

 

(b)

cin

 

(c)

coi

 

(d)

cinout

 

Answer:

Option (b)

14.

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

#include <iostream>

    using namespace std;

    int main ()

    {

        int i;

        cout << ""Please enter an integer value: "";

        cin >> i + 4;

        return 0;

    }

 

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

#include <iostream>

    using namespace std;

    int main ()

    {

        int i;

        cout << ""Please enter an integer value: "";

        cin >> i + 4;

        return 0;

    }

 

(a)

73

 

(b)

your value + 4

 

(c)

Error

 

(d)

63

Answer:

Option (c)

15.

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

#include <iostream>

    using namespace std;

    int main( )

    {

        char line[100];

        cin.getline( line, 100, 't' );

        cout << line;

        return 0;

    }

 

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

#include <iostream>

    using namespace std;

    int main( )

    {

        char line[100];

        cin.getline( line, 100, 't' );

        cout << line;

        return 0;

    }

 

(a)

100

 

(b)

t

 

(c)

It will print what we enter till character t is encountered in the input data

 

(d)

200

 

Answer:

Option (c)

16.

How many parameters are there in getline function?

ગેટલાઇન ફંક્શનમાં કેટલા parameters છે?

 

(a)

1

 

(b)

2

 

(c)

2 or 3

 

(d)

3

 

Answer:

Option (c)

17.

What can be used to input a string with blank space?

blank space સાથે string ઇનપુટ આપવા માટે શું વાપરી શકાય છે?

 

(a)

inline

 

(b)

getline

 

(c)

putline

 

(d)

setline

 

Answer:

Option (b)

18.

 Which is used for formatting purpose in c++?

c++ માં formatting purpose માટે શું વપરાય છે?

 

(a)

Whitespace

 

(b)

Container

 

(c)

&

 

(d)

Vector

 

Answer:

Option (b)

Showing 11 to 18 out of 18 Questions