COMMENTS IN C,C++ , PYTHON AND JAVA

 COMMENTS IN C,C++ , PYTHON AND JAVA:

Comments are the part of code which will not execute when the code is executed these comments can be used as a references of the code and these are very helpful when you are presenting the code to some one  different languages have different types of syntax for comments In this blog we will see how comments are executed in C,C++,Python and Java. The Comments are almost same in C,C++ and Java and it is different in Python. 

There are two types of comments in any language:

  1. Single-line Comments
  2. Multi-line Comments
Single-line and multi-line Comments in C:

#include<stdio.h>

int main(){

//This is a single line comment in C

/*This is a multiple line comment in C

this is the line 2*/

}

Single and multi-line Comments in C++:

#include<bits/stdc++.h>

using namespace std;

int main(){

//This is a single line comment in C++

/*This is a multi line comment 

in C++ */

}

Single and multi-line Comments in Python:

#This is a single line comment in python

'''This is a multi-line comment in python

  This is the second line.'''

Single and multi-line Comments in Java:

Class A{

Public Static Void Main(String args[]){

// This is a single line Comment in Java.

/*This is a multi line Comment in java

   This is the second line*/

In the upcoming posts we will see more about Python, C, C++, JAVA and some tech kind of things. Thank you for visiting TECHINOOBS if you have any suggestion please don't hesitate to post them in the comments.

Comments