TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Tuesday 26 May 2020

C++ Comments Programming Language | C++ Comments Language In Hindi | C++ Comments Programming Language Example

C++ Comments


Comments can be used to explain C++ code, and to make it more readable. It can also be used to prevent execution when testing alternative code. Comments can be singled-lined or multi-lined.

Single-line comments start with two forward slashes (//).

Any text between //  and the end of the line is ignored by the compiler (will not be executed).


image of C++ Comments
Fig: C++ Comments

Single line Program:

#include <iostream>

using namespace std;

int main() {

  // This is single line comment

  cout << "Hello World!";

  return 0;

}


Output:

Hello World

 

Multi-line comments start with  /* and ends with */.

Any text between  /* and */ will be ignored by the compiler:

 

Multi-Line program:

#include <iostream>

using namespace std;

int main() {

  /* this is multi-line comments and print

 hello world */ 

  cout << "Hello World";

  return 0;

}


Output:

Hello World


No comments:

Post a Comment