Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
130 views
in Data Types and Operators by (32.9k points)
closed by

A student wants to insert his name and school address in the C++ program that he has written. But this should not affect the compilation or execution of the program. How is it possible? Give an example.

1 Answer

+1 vote
by (30.8k points)
selected by
 
Best answer

He can use comments to write this information. In C++ comments are used to write information such as programmer’s name, address, objective of the codes etc. in between the actual codes. This is not the part of the programme. 

There are two types of comments. 

i) Single line (//) and 

ii) Multi line (/* and */)

i) Single line (//) : Comment is used to make a single line as a comment. It starts with //. 

Eg : //programme starts here.

ii) Multi line (/* and */): To make multiple lines as a comment. It starts with /* and ends with */. 

Eg : !* this programme is used to find sum of two numbers.*/

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...