C++ GRADE A QUESTION WITH ANSWER
In a C++ program, two slash marks (//) indicate - (correct answer)The beginning of a
comment
Every complete C++ Program must have a _____ - (correct answer)Function named
main
For every opening brace in a C++ program, there must be a - (correct answer)Closing
Brace
A statement that starts with a # is called a - (correct answer)Preprocessor directive
This is used to mark the end of a complete C++ programming statement. - (correct
answer)Semicolon
What will the following code display?
cout << "Four\n" << "score\n";
cout << "and" << "\nseven";
cout << "\nyears" << " ago" << end; - (correct answer)Four
score
and
seven
years ago
What will the following code display?
, cout << "Four" << " score" << end;
cout << "and" << " seven" << end;
cout << "years" << " ago" << end; - (correct answer)Fourscore
andseven
yearsago
The ______ is/are used to display information on the computer's screen. - (correct
answer)Cout object
____________ must be included in any program that uses the cout object. - (correct
answer)The header file iostream
Including the following namespace will allow you simplify you code. - (correct
answer)std
To output multiple lines of text to the user, you must use more than one cout statement.
- (correct answer)False
The end of a printed line can be signaled by sending _____ to the cout object - (correct
answer)endl
How would you consolidate the following declaration statements into one statement?
int x = 7;
int y = 16;
int z = 28; - (correct answer)int x = 7, y = 16, z = 28;
_____________ represent storage locations in the computer's memory. - (correct
answer)Variables
In a C++ program, two slash marks (//) indicate - (correct answer)The beginning of a
comment
Every complete C++ Program must have a _____ - (correct answer)Function named
main
For every opening brace in a C++ program, there must be a - (correct answer)Closing
Brace
A statement that starts with a # is called a - (correct answer)Preprocessor directive
This is used to mark the end of a complete C++ programming statement. - (correct
answer)Semicolon
What will the following code display?
cout << "Four\n" << "score\n";
cout << "and" << "\nseven";
cout << "\nyears" << " ago" << end; - (correct answer)Four
score
and
seven
years ago
What will the following code display?
, cout << "Four" << " score" << end;
cout << "and" << " seven" << end;
cout << "years" << " ago" << end; - (correct answer)Fourscore
andseven
yearsago
The ______ is/are used to display information on the computer's screen. - (correct
answer)Cout object
____________ must be included in any program that uses the cout object. - (correct
answer)The header file iostream
Including the following namespace will allow you simplify you code. - (correct
answer)std
To output multiple lines of text to the user, you must use more than one cout statement.
- (correct answer)False
The end of a printed line can be signaled by sending _____ to the cout object - (correct
answer)endl
How would you consolidate the following declaration statements into one statement?
int x = 7;
int y = 16;
int z = 28; - (correct answer)int x = 7, y = 16, z = 28;
_____________ represent storage locations in the computer's memory. - (correct
answer)Variables