Comments are the non executable statements.They doesn't affect the size of program.comments are use to explain the code of program.They increase program readability and understanding.They also help in modifying and debugging of program.There are two ways of writing comment.
- Single line
- Multiple line
Comments on single line are added by using double slash "//".
Example:
//practice makes a man perfect.
Multi line comment:
Comments on multi line are added by placing /* at the beginning of comment,The character */ is used to end multi-line comment.
Example:
/*practices makes
a man perfect.*/
No comments:
Post a Comment