A Guide To Hello World in C++

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

A guide to Hello World in C++:

1) Open a text editor.


2) Type the following text as is:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!" << endl;
return 0;
}
3) Save the program as hello.cpp
4) Compile the above program using any C++ compiler (eg. g++) by typing the foll
owing command in the terminal.
CC hello.cpp
5) Run the program using the following command in the terminal.
./a.out
6) The output is printed on the terminal.

You might also like