Comments in C Language

Comments in C Language

Comments in C language are used  to provide extra details about various aspects of a program. They are usually included at the start of a program to indicate its purpose, its author and the date on which it was written. They also provide clarification about complicated statements in the program.

There are two types of comments used in C. These are single line comments and Multi line comments. Details about these are given as follows:

Single Line Comments

These comments are only on a single line and cannot move beyond that. They are represented using double slash (//). An example of single line comments in C is:

The output of above program is:

Comments in C

Multi Line Comments

These comments can be extended over multiple lines. They are represented using slash asterisk (/*……….*/). Multi line comments cannot be nested. An example of multi line comments in C is:

The output of this program is:

Comments in C Language

 

Constants in C Language
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create free tutorials for all.

No Comments

Post A Comment