First C++ Program Example
/* first C++ program */
/* Required Header files are 1st included */
/* Every C++ program starts with a main function. The function type is defined as “int” here. We will study function types in detail in further chapters. */
/* The function printf is used to display output on the screen. */
return 0; /* As we have declared an int function so it must return some integer value */
This program prints – Hello World – on the screen and takes the cursor to next line. \n is used to break line and move the cursor to next line.