programminghead Logo

Comments in C Language

There is several time we need to write Comments About the Code so other user can Identify What is the Code about.
Or some line of Codes or Characters we Don't want Compiler to run Or skip, in those Cases we use Comments.
But There Are Two Types of Comments In C Language

Single Line Comment

Single Line Comments just Control the Single line of Code or Character.We just have to write those line Who we want to Hide or don't want to Execute on run After These // Double slash sign.

Single line Comment Syntax


// This Is A Single Line Comment

MultiLine Comment

Multi Line Comments can Control Multi line of Code or Character. We just have to write those lines Who we want to Hide or don't want to Execute on run Between These /* */ slash asterisk and asterisk slash sign.

Multi line Comment Syntax


/* 
   line 1
   line 2
   line 3
*/

Using Comments as a Guide :

Most commonly Comments are used to specify or placing lines as a Guide so another user can easily Identify the Element/Code.
Using comment we can declare some kind of small Definition for our Element/Code and Compiler will ignore those lines and Export/Run our program without any Problems.

Using Comments as a Guide Example


#include<stdio.h>
main(){

     int a=1; //this will create a Variable and assign 1 to the variable's value 
     printf("hellow"); //this will export hello on the Result screen

     /* 
     this will commented out the Code
       printf("bye");
     so code won't Display on the Result screen
     */
}

Results:

hellow

Syntax C Program Language (Explained):

#include<stdio.h> :

#include<stdio.h> is a Header file that includes Slandered (str) Input Output (IO) Library/File. Because All Of the C's In build Functions are declared in <stdio.h> File

main() :

main() (main function) is the entry point of C program. When We Run our C program the execution Control Directly to the main() (main function) and gave us result in output.

printf() :

printf() is also a Function of C. Printf() is used to print “character, string, float, integer,etc” to the output screen.
So what ever we write between printf() inverted commas (" ") that will be printed on the output Screen

// Single Line Comment

Single Line Comments just Control the Single line of Code or Character.We just have to write those line Who we want to Hide or don't want to Execute on run After These // Double slash sign.

/* */ MultiLine Comment

Multi Line Comments can Control Multi line of Code or Character. We just have to write those lines Who we want to Hide or don't want to Execute on run Between These /* */ slash asterisk and asterisk slash sign.

getch()

getch usually used to get Character values but here we are using getch to add a pause to the output so we can see our values in the Output Screen.

Comments

google

https://www.hoger-in-google-solutions.nl/
07:09 pm

Hello this is somewhat of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I'm starting a blog soon but have no coding experience so I wanted to get advice from someone with experience. Any help would be enormously appreciated!

minecraft free download pc

http://1pl.ru/user/SalvatoreBushby/
08:11 am

There's definately a lot to find out about this subject. I like all of the points you have made.

download minecraft

http://tinyurl.com/y6n9fgem
03:21 pm

If some one wishes to be updated with hottest technologies after that he must be pay a visit this web site and be up to date all the time.

loonadministratie breda

https://www.nnadministratie.nl
01:45 am

I'm not sure where you're getting your info, but great topic. I needs to spend some time learning more or understanding more. Thanks for magnificent info I was looking for this information for my mission.

mojang minecraft download

http://tinyurl.com/yxk33jo4
10:43 am

I don't even understand how I stopped up here, however I thought this publish was once good. I don't understand who you might be but definitely you're going to a famous blogger in case you aren't already. Cheers!

minecraft download

http://tinyurl.com/yxwj4km8
04:26 am

bookmarked!!, I love your site!

g

http://tinyurl.com/yy7p7gk5
11:33 pm

Hello my loved one! I wish to say that this article is amazing, great written and include almost all significant infos. I would like to peer extra posts like this .

how to download minecraft free

http://tinyurl.com/yycd7ck8
05:51 pm

Do you have any video of that? I'd care to find out some additional information.

g

http://bit.ly/3078WYE
12:02 pm

It's not my first time to pay a quick visit this web site, i am visiting this site dailly and take fastidious information from here daily.

g

http://tinyurl.com/y6q3noeh
07:02 am

Appreciating the time and energy you put into your website and detailed information you provide. It's awesome to come across a blog every once in a while that isn't the same outdated rehashed material. Wonderful read! I've saved your site and I'm adding your RSS feeds to my Google account.

minecraft download mojang

http://tinyurl.com/y6kdz3lw
11:52 am

Hey are using Wordpress for your site platform? I'm new to the blog world but I'm trying to get started and set up my own. Do you need any coding expertise to make your own blog? Any help would be really appreciated!

minecraft free download

http://bit.ly/2WnX5TW
09:59 pm

Hi there are using Wordpress for your blog platform? I'm new to the blog world but I'm trying to get started and create my own. Do you need any coding expertise to make your own blog? Any help would be greatly appreciated!

download minecraft

http://tinyurl.com/y4cpqg7n
05:33 pm

Ridiculous quest there. What happened after? Good luck!

minecraft free

http://j.mp/2vHEVkk
11:48 pm

Wonderful website. Plenty of useful information here. I am sending it to a few pals ans also sharing in delicious. And naturally, thanks in your sweat!

download minecraft for free

http://j.mp/2WnX5TW
12:59 pm

I know this web page presents quality based content and other material, is there any other site which gives these kinds of information in quality?

gamefly free trial

http://tinyurl.com/yxaa6ls6
03:46 pm

We are a group of volunteers and opening a new scheme in our community. Your site offered us with valuable info to work on. You've done a formidable job and our entire community will be grateful to you.

gamefly free trial

http://tinyurl.com/y6rwxpk3
07:25 pm

I'd like to find out more? I'd like to find out some additional information.

gamefly

http://tinyurl.com/y4lmlhn5
01:53 pm

There is definately a great deal to know about this topic. I love all the points you made.

gamefly

http://j.mp/2Lf197O
09:40 am

I visited multiple websites except the audio feature for audio songs current at this web site is really wonderful.

gamefly free trial

http://bit.ly/2XUuMwH
08:07 pm

Wow that was unusual. I just wrote an really long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyway, just wanted to say excellent blog!

Write to Us