The 1st C++ program

in #coding8 years ago (edited)



A simple C++ program to display "Hello, World!" on the screen. Since, it's a very simple program, it is often used to illustrate the syntax of a programming language. 

I recommend to download : Dev C++ 

This application is used to program in C and C++ 

Write down the program down below on a new source file , to do that click on File , New , Source File 

When you are done with writing the program , press on execute then compile & run , to compile the written code.



INPUT :


 

#include <iostream>
using namespace std;
int main() 
{
    cout << "Hello, World!";
    return 0;
}


OUTPUT :

 

Hello, World!


Meanings :

  • iostream is a header file for  input/output streams 
  •  std is an abbreviation of standard. std is the standard namespace. cout, cin and a lot of other things are defined in it 
  •  Int is short for "integer." Int is a fundamental type built into the compiler and used to define numeric variables holding whole numbers. 
  • Every C++ program starts from the main() function.
  • The cout is the standard output stream which prints the "Hello, World!" string on the monitor.
  • The return 0; is the Exit status" of the program.

Comment below for next tutorials recommended !

Sort:  

This brings back old memories. Gonna have to follow to keep an eye on you. lol. Have a good one.

happy to hear that

You ever do any Arduino stuff or Mobile dev?

yes , Arduino and mobile apps