answersLogoWhite

0

Comments are user-defined remarks inserted into code to give the reader more information than is provided by the code alone. Comments are ignored by compilers.

In C (and C++) there are two types of comment: single-line comments and multi-line comments. A single line comment begins with a double-slash (\\) and extends to the end of the line. A multi-line comment starts with a slash-asterisk (\*) and extends to the first occurrence of an asterisk-slash (*/). Multi-line comments need not extend across multiple lines, they can also be used to insert comments inside code on a single line.

Note that outside of tutorial code, comments should never just repeat what the code does; the code itself tells you what it does, but it may not be clear why it is doing it. Comments should be brief and informative but should not distract the reader with any unnecessary detail.

User Avatar

Wiki User

8y ago

What else can I help you with?

Continue Learning about Engineering

What are its program components?

the main() function,the#include Directive, the variable definition. function prototype, program statements, the function definition,program comments and braces are the components of program in C++


Dry run table in flow-chart?

/* my second program in C++ with more comments */ #include <iostream> using namespace std; int main () { cout << "Hello World! "; // prints Hello World! cout << "I'm a C++ program"; // prints I'm a C++ program return 0; }


What is comment in c programming?

COMMENT:- comment a re not necessary in the program. however, to understand the flow of programs the programmer can include comments in the program. comment are to be inserted by the programmer. It is useful for documentation.Comment are nothing but some kind of statements which are placed between the delimiters /* & */. The compiler does not execute comments. Thus, we can say that comments are not the part of executable program.The user can frequently use any number of comments that can be placed any where in the program. Please note that the comments and statements can be nested. The user should select the OPTION MENU of the editor and select the COMPILER - SOURCE -NESTED COMMENTS ON/OFF). The Comments can be inserted with a single statement or in nested statement.Types of comment in c/c++. is following bellow1. // this is a single line comment2. /* */ this sing is multi line OR nested line commentseg. /* int i=90;char ch=65; */ close multi line commentsmade by [ARUN KUMAR RAI]


What is A program that has its own documentation called?

comments


A new programmer whom you are training is writing a C program and wants to place comment lines in the program what characters should be used at the beginning and end of the comments?

if single line comment just place // before for single line comment else if multiple line denote as like this /*............................. ..............................*/ Strictly speaking, // is non.standard in C only in C++

Related Questions

How do you remove comment from c program?

There are no comments in C programs. Comments only exist in the source code and the precompiler automatically strips them out before the compiler sees them.


Can comments be longer than one line and if yes how?

C++ also supports C program's multiple command line /* your command */.


What are its program components?

the main() function,the#include Directive, the variable definition. function prototype, program statements, the function definition,program comments and braces are the components of program in C++


Why are comments not compiled in a computer program?

'cos' they are just comments.


Dry run table in flow-chart?

/* my second program in C++ with more comments */ #include <iostream> using namespace std; int main () { cout << "Hello World! "; // prints Hello World! cout << "I'm a C++ program"; // prints I'm a C++ program return 0; }


What C program for display in triangle?

Please visit http://talentsealed.blogspot.com/2009/10/to-display-triangle-using-c-programming.html for the answer. Please let me know your comments


Why do programmers add comments to their code even though the computer itself ignores them?

The comments are there to (a) aid in debugging the program, (b) help the programmer layout the program in logical steps and (c) show anyone else looking at the code to see what each section of the code actually does.


What is comment in c programming?

COMMENT:- comment a re not necessary in the program. however, to understand the flow of programs the programmer can include comments in the program. comment are to be inserted by the programmer. It is useful for documentation.Comment are nothing but some kind of statements which are placed between the delimiters /* & */. The compiler does not execute comments. Thus, we can say that comments are not the part of executable program.The user can frequently use any number of comments that can be placed any where in the program. Please note that the comments and statements can be nested. The user should select the OPTION MENU of the editor and select the COMPILER - SOURCE -NESTED COMMENTS ON/OFF). The Comments can be inserted with a single statement or in nested statement.Types of comment in c/c++. is following bellow1. // this is a single line comment2. /* */ this sing is multi line OR nested line commentseg. /* int i=90;char ch=65; */ close multi line commentsmade by [ARUN KUMAR RAI]


What is A program that has its own documentation called?

comments


What is a short notes placed in different parts of a program explaining how those parts of the program work?

Comments P.64 - Bottom of page


Are used to document a program and improve its readability?

Comments


What is the purpose of using comments in c plus plus?

Comments are to help other programmers (or yourself in the future) to understand what is going on in a program, especially when the code itself is complicated and may not be obvious. More time is spent maintaining and improving programs than original development, so leaving clear comments is very important!