How to use single line comment in C?


Arun Verma

Single Line Comment in C

In C programming single line comment is used to hide a line of code from being compiled by C compiler. 

If you are commenting a line then that line is not going to be a part of your C program. Single line comment is very easy to use, just you have to put // at the beginning of the line. Let's take an example.


int a=20, b=30, c=0;

// sum here


printf("The sum of a and b is %d", c);


The sum of a and b is 50

In the above program, you can see I have used single line comment 

1 votes

Your Answer

Email Us:

Donate Us: Support to GDATAMART

LifeStyle & Fun

© 2024 GDATAMART.COM (All Rights Reserved)