Following are the multiple choice questions from C++. Please scroll down to check the answers.
Identify the correct statement
a. Programmer can use comments to include short explanations within the source code itself.
b. All lines beginning with two slash signs are considered comments.
c. Comments very important effect on the behaviour of the program
The directives for the preprocessors begin with
a. Ampersand symbol (&
b. Two Slashes (//)
c. Number Sign (#)
d. Less than symbol (<
The file iostream includes
a. The declarations of the basic standard input-output library.
b. The streams of includes and outputs of program effect.
c. Both of these
d. None of these
There is a unique function in C++ program by where all C++ programs start their execution
Every function in C++ are followed by
c. Curly braces
d. None of these
Which of the following is false?
a. Cout represents the standard output stream in c++.
b. Cout is declared in the iostream standard file
c. Cout is declared within the std namespace
d. None of above
Every statement in C++ program should end with
a. A full stop (.)
b. A Comma (,)
c. A Semicolon (
d. A colon (
Which of the following statement is true about preprocessor directives?
a. These are lines read and processed by the preprocessor
b. They do not produce any code by themselves
c. These must be written on their own line
d. They end with a semicolon
A block comment can be written by
a. Starting every line with double slashes (//)
b. Starting with /* and ending with */
c. Starting with //* and ending with *//
d. Starting with <!- and ending with -!>
When writing comments you can
a. Use code and /* comment on the same line
b. Use code and // comments on the same line
c. Use code and //* comments on the same line
d. Use code and <!- comments on the same line
1. b. All lines beginning with two slash signs are considered comments.
2. c. Number Sign (#)
3. a. The declarations of the basic standard input-output library.
4. c. Main()
5. b. Parenthesis
6. d. None of above
7. c. A semicolon
8. d. They end with a semicolon
9. b. Starting with /* and ending with */
10. b. Use code and // comments on the same line
|< Prev||Next >|