Comments in C

Comments are to provide a piece of information about the code. A comment can help the other programmers to understand the program flow. In C Programming Language, there are two types of commenting options: Single Line and Multi-line.

C 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.

#include<stdio.h>

int main()
{
    // Printing Hello World Message as Output
    printf(" Hello World! \n");

    return 0;
}
 Hello World! 

Multi-Line Comments Example

The Multi-Line Comments placed in between /*……… */. Use this Slash and asterisk to write a multi-line.

#include<stdio.h>

int main()
{
    /*
     Print
     Message
     as an Output
     */
    printf(" Welcome to Tutorial Gateway \n");

    return 0;
}
C Comments example 2