Comments are used to document the c source code, It makes source code more readable & easier to understand. Compiler ignores the comments.
c language has two types of comments
- Single line comment
- Multiline comment
Single line comment
// I am single line comment
Example
void main()
{
// Outputs Hello World
printf("Hello world");
}
Multiline comment
/*
I am
Multi line
comment
*/
Example
void main()
{
/*
Outputs Hello World
to the screen
*/
printf("Hello world");
}