COMMENTS IN PROGRAMS
Comments can be used in programs for clarification purposes. The comment lines are ignored by the compiler. There are two ways of including comments in a program. One way is to use double slashes (‘//’) before a comment line. Any characters after the double slashes (‘//’) are ignored by the compiler. For example,
Comment lines starting with the ‘//’ characters can be used anywhere in a program.
Another way of creating comment lines in a program is to start the comments with the characters ‘/*’, insert the comments, and then terminate the comments with the ‘*/’ characters.
This method has the advantage that the comments can extend to several lines. An example is given below: