Comments are a way of explaining what makes a program. Comments are ignored by the compiler and used by others to understand the code.
C++ Header Files - this is a preprocessor directive. It tells the preprocessor to include the contents of iostream header file in the program before compilation. This file is required for input output statements.
int/void is a return value, which will be explained in a while.
The main() is the main function where program execution begins. Every C++ program should contain only one main function.
The return instruction makes the main() to finish and it returns a value, in this case it is returning 0.
Simple example of a C++ program that prints a string on the screen.
If you specify using namespace std then you don’t have to put std:: throughout your code. The program will know to look in the std library to find the object. Namespace std contains all the classes, objects and functions of the standard C++ library.
Note : endl among other things, will flush the stream.