The correct option is (d)
Explanation:
To include the herder files in the C++ program user can use any of the following given syntax.
#include “filename.h”
OR
#include
2.Which is the correct syntax to print the message in C++ language?
a. cout <<"Hello world!";
b. Out <<"Hello world!;
c. Cout << Hello world! ;
d. None of the above
The correct option is (c)
Explanation:
A language that can generate the new data types is known as the extensible languages as they can handle the new data types.
5. In the C++, for what purpose the “rank()” is used?
a. It returns the maximum number of elements that can be stored in the array.
b. It returns the dimension of the specified array.
c. It returns the size of each dimension.
d. None of the above.
The correct option is (b)
Explanation:
In C++, one can use the rank function where he wants to know about the dimensions( e.g., single-dimension, multi-dimension) of a specific array by just passing it to the “rank()” function.
6. Which of the following can be considered as the object of an array?
a. Elements of the Array.
b. Functions of the Array.
c.Elements of the Array
d.All of the above
The correct option is (c)
Explanation:
The “Private” member of a class can be inherited by the child class. Still, the child class cannot access them (Or we can say that they are not accessible from the child class).
8. Which of the following statement is not true about C++ ?
a. Members of a class are public by default.
b. A structure can have the member functions.
c. A class cannot have the private members
d. All of the above
The correct option is (b)
Explanation:
In C, structures are not allowed to have member functions; while on the other hand, C++ allows the structure to have the member functions. Members of the class are generally private by default, and those of the structures are public. So it is a completely false statement that classes can not private members.
8. Which one of the following cannot be used with the virtual keyword ?
a. Destructors
b. Member function
c. Constructor
d. None of the above
The correct option is (c)
Explanation:
In The C++, we cannot use the virtual keyword with the Constructor because constructors are generally defined to initialize the object of a specific class; hence no other class requires the other class’s object.