In this article I will explain you small and important term of C
language i.e, comments.
Below the article I will provide a link to watch the video of implementation
comments in C programming language.
COMMENTS IN C LANGUAGE
TYPES OF COMMENTS:
1) SINGLE LINE COMMENT-
Comments are non-executable code used to provide documentation to programmer. Single Line Comment is used to comment out just Single Line in the Code. It is used to provide One Liner Description of line.
Example -
#include<stdio.h>
void main()
{
printf("Hello"); //Single Line Comment
printf("Bye");
}
2) MULTI LINE COMMENT-
1) Multi line comment can be placed anywhere.
2) Multi line comment starts with /*.
3) Multi line comment ends with */.
4) Any symbols written between '/*' and '*/' are ignored by Compiler.
5) It can be split over multiple lines.
Example -
#include<stdio.h>
void main()
{
printf("Hello");
/* Multi line
Comment
*/
printf("Bye");
}
RULES OF WRITING COMMENT-
1) Nested Comments are not allowed i.e Comment within Comment.
2) Comments can be split over more than one line.
3) Program Contain Any number of comments at any place.
4) Comments are not Case-Sensitive.
5) Single line Comments Starts with ‘//’.
DIFFERENCE BETWEEN MULTI LINE COMMENT AND SINGLE LINE COMMENT -
0 Comments