+ 1

is it necessary to add a comment to print a text

EX :- cout<<Suvan is enough to print a word then why should we use //print "Suvan" cout<<suvan

24th Apr 2018, 12:34 PM
B.Suvan Sathyendira
B.Suvan Sathyendira - avatar
2 Answers
+ 2
A comment will NOT print out any code at all, it's unrelated. //This is a comment, and noone will know it even exists. All a comment does is make code easier to read, as opposed to just random letters and symbols, numbers, and things of the like.
24th Apr 2018, 1:28 PM
What was my name again?
What was my name again? - avatar
+ 1
No it is not necessary to add a comment to print a string. However, a string should be between double quotes.
24th Apr 2018, 12:40 PM
jerome