Use of Comments in Programming

This question may be arising in your mind about comment word. You might be thinking that why to use the comment in the program and what is the use of comments? Whether it is a part of program or whether it is important to add comment for running of the program so I will answer all your doubt in your mind.

Comments are unexecutable part of any program written in any language.It is added in programs just for reference.

Suppose you have written a 100+ line program to get a Output.Well you might be knowing the full program right now.But what if others will open your program and try to understand.He may not understand your program because may be he is a new programmer or any other reason.

So,Comments are added after some line to show why this concept is used here for the future reference so that if you or any other person will open that particular program then he can understand the whole program if you have inserted comments at important lines of the program.

So,My advice is to use comment /* comment */ so that it will be beneficial in the future to understand your past program.

Tips: You can right any thing starting with // or /// to show as a comment or you can also use /* wrie here */ to write your comments for that program.

This is all about Comments.If you have any comment then please share here.

Thank you.

Pankaj Gupta

Like it on Facebook, Tweet it or share this article on other bookmarking websites.

No comments