What is a Comment?
Comment is a statement in a program that is just for programmer to understand the code better.
For example,
int r;
Here, I declared integer variable ‘r’. I know that I declared it as I want to refer it to ‘Radius’, but another programmer who is reading my code don’t know that ‘r’ here is reffered to Radius, so I can write here a comment telling that ‘r’ is a radius here. Just like I did below:
int r; //r means Radius
So here ‘//r means Radius’ is a comment
Note: Comments are not read by the compiler so, compiler skips that part. It is not executed or seen in actual program.
Different Programming languages have different style of defining comments.