Hello world program

This program has very simple code but it is used to understanding for the newbies.In the beginning of the programming language learn this example.


lets see the "Hello world" program

code:

//first program in c++

#include<iostream>


int main()

{

std::cout<<" Hello world";

return 0;

}

Output:

Hello world


How Hello world program work

In the first line,(//) comment is used to explain what is doing here,It is useful for code reader to understand what actually code does.

For now,In the second line, library iostream is used to court something on the screen.

The main() must involve in the c++ code because execution start from this main() function.

std:: cout<<" Hello world "; is used to display message on the screen.

return 0 is exit statement for c++ program in the main()  function.


Comments

Popular posts from this blog

Flutter layout

how to cout in cpp

Diferrence between flutter and react native