C - Comments

Comments are the statements which are not executed and ignored by the compiler. Comment is useful when a team is building a project it helps other programmer to understand the code easily. Comments provide information about lines of code. It is widely used for documenting code.

There are 2 types of comments in C-Language:

  1. Single line comment – Single line comment are represented by double forward slashes - //
  2. void main()
    {      
        printf("I'm learning C Programming");
        //printf("I'm learning CPP Programming");
        //printf("I'm learning Java Programming");
        //printf("I'm learning .Net Programming");
        getch();
    }
    I'm learning C Programming
  3. /*...*/ - Multi line comments are represented by slash asterisk. It can occupy many lines of code.
  4. void main()
    {      
        printf("I'm learning C Programming");
        /*printf("I'm learning CPP Programming");
        printf("I'm learning Java Programming");
        printf("I'm learning .Net Programming");*/
        getch();
    }
    I'm learning C Programming
: Any number of comments can be placed anywhere in between the program.