Comments in C Programming Language are to provide a piece of information about the code. This can helps the other programmers to understand the program flow.
In C Programming Language, there are two types of commenting options, and they are Single Line and Multi-line.
Single Line Comment Example
The Single Line comments start with two forward slashes(//).
In this program, we are displaying Hello World as the C Programming output. Here, we used a single line comment
/* Single Line Comments in C */ #include<stdio.h> int main() { // Printing Hello World Message as Output printf(" Hello World! \n"); return 0; }
OUTPUT
C Multi-Line Comments Example
The Multi-Line Comments placed in between /*……… */. Use this Slash and asterisk to write a multi-line comment.
/* Multi Line Comments in C */ #include<stdio.h> int main() { /* Print Message as an Output */ printf(" Welcome to Tutorial Gateway \n"); return 0; }
OUTPUT