About Me

Hello there! Before talking about qualifications and professional abilities, I would like to introduce myself. I am a Yuvraj Basnet and professional software developer and have been working in this field for 3 long years. I have finished my graduation from The University of Delhi on Computer Science Engineering I considered myself a reasonably experienced programmer with a particular interest in the human side of software development, computers are fascinating machine, but they're mostly reflection of the people using them. In the art of software development, studying code isn't enough; you have to study the people behind the software, too.

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