is it possible to use /* for both multiple and single lines?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

is it possible to use /* for both multiple and single lines??

26th Jul 2018, 10:34 PM
saba-hs
saba-hs - avatar
8 Answers
+ 8
yes. /**/ use for both single and multiple lines comment. but it is a good practice to use // for single line comment.
26th Jul 2018, 10:46 PM
Mahdi Salek
Mahdi Salek - avatar
27th Jul 2018, 5:26 PM
saba-hs
saba-hs - avatar
+ 3
Yeah . You can use "/* */ "for multiple and single line comments but "// " only for single line comments.
27th Jul 2018, 5:31 PM
Albie
Albie - avatar
+ 2
// - single line /* comments */ also used
27th Jul 2018, 2:28 PM
Ganesh Phapale
Ganesh Phapale - avatar
+ 2
saba-hs your welcome ✋ good luck ✌
27th Jul 2018, 5:43 PM
Mahdi Salek
Mahdi Salek - avatar
+ 2
yes you can use "\*" instead of \\. \* can be used for single as well as multiple line comments but if there is only a single line comment then it is helpful to practice \\
12th Aug 2018, 3:56 AM
Priyansh Bhardwaj
Priyansh Bhardwaj - avatar
+ 1
Use \\ when commenting next to your statement int a; \\declaring variable. And use \* *\ when you want to describe about your code. See this https://code.sololearn.com/cfob4Ie8GuGW/?ref=app Hope this helps ☺️☺️.
27th Jul 2018, 4:54 AM
Meet Mehta
Meet Mehta - avatar
- 1
yes :)
11th Aug 2018, 7:46 AM
Inna Moroz
Inna Moroz - avatar