- C++ is an extension of C language. One of the new features added is:
- Structure
Union
- Operator overloading
- Function
- Which of the following statements is FALSE?
- In a C++ program, the execution begins at main() function.
- Every C++ program must have a main() function.
Every C++ statement must end with a semicolon.
- C++ does not permit the use of printf() for displaying an output.
- Line commands are inserted into a C++ program using
Left and right curly brackets like {…}
- Double forward slashes like //…..
- Stars and slashes like /*..…*/
- A colon like this : …..
- For declaring the variables a and b, which of the following declaration statements is incorrect?
- int a, b; // Declaration
int a, /* Declaration*/ b;
- int a, // Declaration // b;
- int a, b; // Declaration //
- For using functions that convert numbers to text and text to numbers, we must include the following header file:
<cstdlib>
- <iostream>
- <cstdio>
- <cmath>
- Which of the following statements provide two lines of output?
- cout << ”VERY”
<< “GOOD”;
- cout << ”VERY” “\n” << “GOOD” “\n”;
- cout << “VERY”<< “GOOD” “\n”;
- cout << ”\nVERY” /*First line */ << “GOOD”; // Second line
- cout << ”VERY”
- Which of the following statements is invalid in C++?
cin >> count;
- cin >> x; >>y;
- cin >> x // >> y;
- cin >> x >>y;
- Which of the following statements requires the header file <math.h> to be included?
- cout <<x/y;
- x + = 10;
x = m*n+1;
- x = sqrt(y);
- Name the header file that is to be used in the #include directive when we use cout for displaying outputs.
- <cstdio>
<cstdlib>
- <iostrean>
- <cassert>
- If a is an object of the class B and void print (void) is a member function of B, then which one of the following statements will invoke the function?
- a::print();
- a.voidprint();
B.print();
- a.print();
Answers:
- Operator overloading
- C++ does not permit the use of printf() for displaying an output.
- Double forward slashes like //…..
- int a, // Declaration // b;
- <iostream>
- cout << ”VERY” “\n” << “GOOD” “\n”;
- cin >> x; >>y;
- x = sqrt(y);
- <iostrean>
- a.print();
You must log in to post a comment.