adspace
Answer Posted / Manish Kumar Jain
Comments in C++ are used to provide explanations or notes within the code. They do not affect the program's execution.nn1) Single-line Comment: A single-line comment starts with two forward slashes (//). Everything after the double slash on that line is considered a comment and ignored by the compiler.nExample:n```cppn // This is a single-line commentn```n2) Multiline Comment: Multiline comments are enclosed between /* and */. These can span multiple lines and are useful for longer explanations or sections of code that you want to temporarily disable without deleting.nExample:n```cppn /* This is a multiline comment
This can span multiple lines
*/n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers