Comments in C

Facebooktwitterredditpinterestlinkedinmailby feather

Comments are used to comment on the line of code in the program. Comments are a way of inserting remarks and reminders into code without affecting its behavior. The compiler ignores comments, treating them as though they were whitespace.

There are two types of comments:

  1. Single Line Comments
  2. Multiple Line Comments

Single Line Comments:

Single line comment is used to comment on the single line of program code. The double slash (\\) is used to comment on a single line.

Syntax:

Example

Output

Multiple Line Comment

Multiple line comments are used to comment multiple line code of the program.

The given syntax is used to comment multiple lines.

 Syntax:

Example

Output
Facebooktwitterredditpinterestlinkedinmailby feather