C Comments
Comments are not read by the compiler and have no influence on the execution of the program.
Single Line Comments
- Single-line comments begin with two forward slashes (//).
- Anything placed between // and the line end is not read by the compiler.
Example
#include
<stdio.h>
int main()
{
//This is a single line comment
printf("Hello Coders!");
return
0;
}
Multi-line comments
- Multi-line comments begin with /* and terminate with */.
- Anything placed between /* and */ will be ignored during compilation.
Example
#include
<stdio.h>
int main()
{
/* This is
a multi line
comment */
printf("Hello Coders!");
return
0;
}