HeÿA ❗❗✌ ✌
___________
✨ Give me differences between single line comment and multi-line comment
#Computer
Answers
Hi,
As name suggests single line comment occupies only one line and multi-line comment occupies multiple lines.
Single line comment:- We can add single line comment in code using double forward slashes //
for e.g. // This is an example of single line comment
Multi-line comment:- When we have to write multiple lines of comment than we use multi-line comment. We can start writing multi-line comment using /* and than we can stop it using */
for e.g.
/*
This is an example of multi-line code
we can write multiple line of comments here.
*/
Why we should add comments in our program?
As we know that in an organization multiple programmers work on same project. So, the well commented functions/logics are helpful to other programmers to understand the code better. They can easily understand the logic behind solving any problem.