1 |
Which of the following is correct way to initialize a variable x of int type with value 10? |
int x ; x = 10;
int x = 10;
int x, x = 10;
x = 10;
|
2 |
The normal source of cin object is |
File
Disk
Keyboard
RAM
|
3 |
Friend function of a class is ______________. |
Member function
Non-member function
Private function
Public function
|
4 |
Which kind of functions can access private member variables of a class? |
Friend functions of the class
Private member functions of the class
Public member functions of the class
Friend, private and public functions
|
5 |
To access the data members of structure _______ is used. |
dot operator
* operator
U operator
None of given
|
6 |
Header file: fstream.h includes the definition of the stream classes __________. |
ifstream, fstream, cout
ifstream, fstream, ofstream
fstream, cin, cout
None of the above
|
7 |
In if structure the block of statements is executed only. |
When the condition is false
When it contain arithmetic operators
When it contain logical operators
When the condition is true
|
8 |
A Matrix can be composed of ints, floats or doubles as their elements. Best way is to handle this. |
Write a separate class to handle each
Use templates
Use strings to store all types
None of the given options
|
9 |
width() is member function of _____________. |
cin object
cout object
Both cin and cout object
None of the given option
|
10 |
The function free() returns back the allocated memory got thorough calloc andmalloc to _____. |
stack
heap
stack and heap
None of the given options
|