Printing to console

The Syntax for printing something as output is different for all the 3 languages.
 

C




// C program to showing
// how to print data
// on screen
 
#include <stdio.h>
 
int main()
{
   printf("Hello World");
   return 0;
}


C++




// C++ program to showing
// how to print data
// on screen
 
#include <iostream>
using namespace std;
 
int main()
{
    cout << "Hello World";
    return 0;
}


Python




# Python program to showing
# how to print data
# on screen
 
print("Hello World")


Comparing Python with C and C++

In the following article, we will compare the 3 most used coding languages from a beginner’s perspective. It will help you to learn basics of all the 3 languages together while saving your time and will also help you to inter shift from one language you know to the other which you don’t. Let’s discuss a brief history of all the 3 languages and then we will move on to the practical learning.
 

Similar Reads

C Vs C++ Vs Python

...

Library and Header files inclusion

Header Files: The files that tell the compiler how to call some functionality (without knowing how the functionality actually works) are called header files. They contain the function prototypes. They also contain Data types and constants used with the libraries. We use #include to use these header files in programs. These files end with .h extension. Library: Library is the place where the actual functionality is implemented i.e. they contain function body.Modules: A module is a file containing Python definitions and statements. A module can define functions, classes, and variables. A module can also include runnable code. Grouping related code into a module makes the code easier to understand and use. Import in python is similar to #include header_file in C/C++. Python modules can get access to code from another module by importing the file/function using import....

Main method declaration

...

Declaring Variables

...

Printing to console

...

Taking Input

Main method declaration is declaring to computer that from here the implementation of my code should be done. The process of declaring main is same in C and C++. As we declare int main where int stands for return type we should have to return something integral at the end of code so that it compiles without error. We can write our code in between the curly braces....