About us

Comments in C


Comments in C

comments-in-c


Generally, Comments are used to provide a description of the logic written in Program. They are not displayed output screen. They are ignored by the Compiler in C Language. There are two types of comments:-

1. Single line comment:-Single line comment can be provided by using the // symbol. After this symbol, we write our comment in a single line.

2. Multi-line comments:-Multiline comments can be provided by using the /* symbols. In this, we use these symbol to write comments in more than one line. Like below:-
/*
-------------
--------------
--------------
*/


Rules for Writing comment:
  1. The program contains any number of comments at any place.
  2. Nested comments are not allowed, that means comment within the comment.
  3. Comment can be split over than one.
  4. Comments are not case sensitive.


Benefits of Comments in the Program


  1. With the help of comments, a Programmer can write a description of his program.
  2. With the help of the comments, a programmer can explain their logic in the program.
  3. It also can write any specific information.


You can also visit:-