TRENDING TOPICS

×

How to use single line comment in C?

By: Sandeep Singh | 03 February 2020

A

Arun Verma

08 February 2020

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.

Example-

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

// sum here

c=a+b;

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

Output

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

Advertise With Us

We offer sponsored posts and guest posts with do-follow links, back-links, and other advertising services, To advertise email us at "advertise@gdatamart.com"

© 2021 GDATAMART.COM (All Rights Reserved)