answersLogoWhite

0


Best Answer

There are two ways:

The single line comment with a double slash //. Everything after the double slash on a single line is commented out.

The multi-line comment using a /* to open, and a */ to close.

A good IDE will color code the comments instantly.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

to write the comment

start the comment by /* and end the comment by */ . everything inside that /* and */ is called comment

/*this is a comment*/

/*this is a comment

this is also comment*/

some compiler also support this way

// is a comment on that line only.

if your comment is multi line, you should put // on the begininng of every line

//this is a comment

//this line is also comment

this line is not comment

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you create a comment in a C plus plus program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you program games with c plus plus?

Yes, you can program games with C++.


Create a c plus plus program to generate Fibonacci series?

#include #include void main() { clrscr() int a=0,b=1,c,i,n; coutn cout


Create a c plus plus program that displays odd numbers between 15 and 30?

for (int i = 15; i < 30; i += 2) cout << i << endl;


How to restart c plus plus program?

Exit the program and relaunch it.


How do you create .exe file in c plus plus?

You can create an exe-file from your C++ source, if you have a compiler.


Lint is a compiler b a interactive debugger c a cinterpreter d a tool for analysing c plus plus program?

d a tool for analysing c plus plus program


C program on left factoring in compiler design?

how to create a c program for left factoring.


How do you write a C plus plus program that will display the first 10 positive prime numbers?

By learning how to program on C+.


Where did C plus plus program come from?

C++ is an extension of C, and was invented by Bjarne Stroustrup.


What is the only function all C plus plus programs must contain?

Every C plus plus program that is a main program must have the function 'main'.


Can you rewrite a cuda file in c c plus plus language?

Yes, you can rewrite a cuda program originally written in c in c plus plus.


Can you read a file after created by a program in C plus plus?

Yes. You can either create a file for both reading and writing, or you can re-open a file for reading after creating and writing to it.