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.
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(){ /*HelloWorld In C program*/ printf("Hello World"); return 0; }
Output
Hello World