Comments In C

Comments In C

Comments are lines which help programmer to understand the code, they are created by programmer for other person so they can easily understand it. Comments are lines which don't get executed in the program they remain as it is.

Comments In C


There are two types of comments in C language.

  • Single Line Comments
  • Multi-Line Comments

Single Line Comments


Single line comments are denoted by two slash //. If you want to create only single line comment then you can use //your comment. 

Code

#include<stdio.h>    
int main(){    
    //basic c program   
    printf("Hello World");    
return 0;  
}    

Output

Hello World


Multi-Line Comments


Multi-Line comments are denoted by slash asterisk /* ... */

Code

#include<stdio.h>    
int main(){    
    /*Hello
World In C program*/  
    printf("Hello World");    
return 0;  

Output

Hello World

C Identifiers
Load comments