Written by - Vanshika Yadav

Comments in C


In c programming, the comment is used to increase the readability of the program.
Whatever we write after the comment is ignored by the compiler.

Types of comments:

Single line comment:


A single comment is represented by the double slash(//).
Now let’s see the example of a single-line comment:

#include<stdio.h>
int main(){
printf("you are worth it!") //comments are gonna ignore by compiler
}

Multi-line comment:


Multi-Line comments are represented by slash asterisk \* ... *\. It can occupy many lines of code, but it can't be nested.
Example of multi-line comment:

#include<stdio.h>
int main(){
/*example of multi-line comment*/
printf("you are worth it!") 
}