Multiple choice

State, if the following comment is valid or not. /* An apple /* a day keeps */ the doctor away */

  1. Valid

  2. Invalid

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

C++ does not support nested comments. Once the compiler encounters the first closing */, it considers the comment complete. The remaining text becomes invalid syntax, causing compilation error.