Which of the following is used for comments in C++ ?
The correct answer is "both // comment or /* comment */".
In C++, comments are used to add explanatory notes or remarks to the source code that are not executed as part of the program. They serve as documentation and aids in understanding the code for both developers and other readers. In C++, there are two ways to write comments: