Computer Science, asked by divyanshi261, 1 year ago

HeÿA ❗❗✌ ✌

___________

✨ Give me differences between single line comment and multi-line comment

#Computer


divyanshi261: fine bhai
divyanshi261: Yup ✌
divyanshi261: u..
divyanshi261: yezz u r my bhai
divyanshi261: no

Answers

Answered by Anonymous
4

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.


divyanshi261: Tnqzz
Similar questions
Math, 7 months ago