Create, Compile and Run the Hello World Program in C++
A school fair needs a welcome screen at the entrance. Print a greeting first. Seeing the exact words on screen confirms that the saved program ran and sent text to its output.
1. Save the following program as HelloWorld.cpp.
#include<iostream>
using namespace std;
int main(int argc, const char * argv[])
{
cout << "Hello World";
return 0;
}
2. Compile with g++ HelloWorld.cpp -o HelloWorld.exe, then run .\HelloWorld.exe in PowerShell.
