Q. How to write a comment on a single line?

  • (A) /* my comment */
  • (B) // my comment //
  • (C) // my comment
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above
Explanation: If your comment is short, you should use a double slash (//) followed by your comment. For example:

// this is a comment

If your comment is long, type your comment between (/* and */). For example:
/* this is a
multi-line
comment */
Explanation by: Rudra Pratap Singh
If your comment is short, you should use a double slash (//) followed by your comment. For example:

// this is a comment

If your comment is long, type your comment between (/* and */). For example:
/* this is a
multi-line
comment */

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
244
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Rudra Pratap Singh
Publisher
πŸ“ˆ
97%
Success Rate