About Me

Hey friends! My name is yuvraj basnet. I'm going to introduce myself.I have born and grown up in india(chandigarh) and I'm studying second year of B.C.A computer science field. My father serving in indian air force. My mother has been taking care of house hold. I am a friendly person, good thinker, I can work for longer hours without any break, only if I'm interested in that...My life style is very simple.

COMMENTS IN C


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 -























Post a Comment

0 Comments