Comments in C++ Language
C++ comments are those statements which are never executed by the compiler. The comments in C++ programming are used to provide explanation about the code, method or class, variable.
There are two types of comments -
- Single Line comment
- Multiline comment
C++ Single Line Comment
These single line comments are starts with double slash (//). Let's look at an example of single line comment in C++.
Output -
10
C++ Multiline Comment
These C++ multiline comments are used to comment multiple lines of statements. It is surrounded by slash and asterisk (/∗ ..... ∗/). Let's look at an example of multiline comment in C++.
Output -
15