CPP Comments MCQ
Cpp MCQ(1) How many types of comments in C/C++
A) 1
B) 2
C) 3
D) 4
Explanation
There are two types of comments in C/C++, which are called single line comment and multi line comment.
(2) Which of the following lines of code skipped by compiler while compilation
A) Sequential
B) Control
C) Comment
D) Preprocessor
Explanation
Comments are non executable statements in C/C++ programs. Compiler ignore comment statements while compilation process so that it does not part of executable file.
(3) Comments can be added _______ in the source code.
A) Top
B) Bottom
C) Anywhere
D) None
Explanation
There is no constrain on adding of comments in source code. Comments can be added anywhere in program.
(4) In C++ multi line comments are starts with.
A) //
B) \\
C) /*
D) */
Explanation
In C++ multi line comments are consist of more than one line in source code. These comments are always starts with /* and end with */
(5) In C++ comments are ____________ statements.
A) Executable
B) Non-Executable
C) Output
D) Input
Explanation
In C++ comment are non-executable statements. The compile does not include these statement in executable code. These statements does not effect the size of executable code.
(6) In C++ single line comments are with.
A) \\
B) //
C) /*
D) None
Explanation
Single line comments are used to comment the current line starts with // ( double slash sign ).