Ace Your C++ Skills 2025 – Rock the ‘Thinking in C++’ Challenge!

Question: 1 / 565

How do C++ comments start and end?

// for single-line and /* */ for multi-line

In C++, single-line comments start with // and end at the end of the line. Multi-line comments start with /* and end with */. Option B is incorrect because # is not used for comments in C++, it is used for preprocessor directives. Option C is incorrect because // is used for single-line comments, but multi-line comments require the use of /* and */. Option D is incorrect because -- is not used for comments in C++, it is used for decrementing.

Get further explanation with Examzify DeepDiveBeta

# for single-line and <!-- --> for multi-line

// for both single and multi-line

-- for single-line and /* */ for multi-line

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy