Comments in C
Comments are used to comment on the line of code in the program. Comments are a way of inserting remarks and reminders into code without affecting its behavior. The compiler ignores comments, treating them as though they were whitespace. There are two types of comments:
- Single Line Comments
- Multiple Line Comments
/-----------------comment with double slash ---------------- /Example
#include <stdio.h> int main(){ // This comment line section will not be show at the time of output printf("tutorialandexample.com"); return 0; }Output
tutorialandexample.comMultiple Line Comment Multiple line comments are used to comment multiple line code of the program. The given syntax is used to comment multiple lines. Syntax:
/* Code 1 code 2 code 3 */Example
#include <stdio.h> int main(){ /*printing Information With Multiple Lines */ printf("Hello C"); return 0; }
Output
Hello C