Hello,world! Part 3

Main



Program execution begins with the main function, int main().
#include <iostream>
using namespace std;

int main()
{
cout << "Hello world!";
return 0;
}
Try It Yourself

Curly brackets { } indicate the beginning and end of a function, which can also be called the function's body. The information inside the brackets indicates what the function does when executed.
The entry point of every C++ program is main(), irrespective of what the program does.

Comments