Structure of a program in C++ Learn

Data+Structure+C+++Programs

C++ Programming Language

Probably the best way to start learning a programming language is by writing a program. Therefore, here is our
first program:
// my first program in C++
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
Hello World!
The first panel shows the source code for our first program. The second one shows the result of the program once
compiled and executed. The way to edit and compile a program depends on the compiler you are using. Depending
on whether it has a Development Interface or not and on its version. Consult the compilers section and the manual
or help included with your compiler if you have doubts on how to compile a C++ console program.


Learn More :