"Comments are useful and easy way to enhance readability and understandability of a program." Elaborate with the examples .
Help me guys ..... :)
Answers
Answer:
here is ur answer ⬇️
Explanation:
Comments can be used to explain the purpose of the program, document the logic of a piece of code, describe the behaviour of a program, etc. This enhances the readability and understandability of a program. For example:
# This program shows a program's components # Definition of function SeeYou() follows def SeeYou(): print("Time to say Good Bye!!") # Main program-code follows now a = 15 b = a - 10 print (a + 3) if b > 5: # colon means it's a block print("Value of 'a' was more than 15 initially.") else: print("Value of 'a' was 15 or less initially.") SeeYou() # calling above defined function SeeYou()
"Comments are a useful and easy way to enhance readability and understandability of a program."
- A comment in a computer application is a programmer-readable basis or annotation in the quotation code of a computer program.
- They are used to make the source code easier for humans for understanding and are mainly ignored by compilers and interpreters. The syntax of comments in several programming languages differs extensively.
- Comments are sometimes used in several manners for generating documentation that is external to the source code itself through documentation generators or is also used for integrating with source code management systems and different kinds of external programming methods.
The flexibility that is provided by comments enables for a broad degree of variability for example C++ has block comments delimited by /* and */ that can extend multiple lines and line comments delimited by //.
#SPJ2