Multi-line Comment in C
The Multi-line comment in C starts with a forward slash and asterisk ( /* ) and ends with an asterisk and forward slash ( */ ). Any text between /* and */ is treated as a comment and is ignored by the compiler.
It can apply comments to multiple lines in the program.
Syntax of Multi-Line C Comment
/*Comment starts continues continues . . . Comment ends*/
Example 2: C Program to illustrate the multi-line comment
C
/* C program to illustrate use of multi-line comment */ #include <stdio.h> int main( void ) { /* This is a multi-line comment */ /* This comment contains some code which will not be executed. printf("Code enclosed in Comment"); */ printf ( "Welcome to w3wiki" ); return 0; } |
Welcome to w3wiki
C Comments
The comments in C are human-readable explanations or notes in the source code of a C program. A comment makes the program easier to read and understand. These are the statements that are not executed by the compiler or an interpreter.
It is considered to be a good practice to document our code using comments.