Basic Structure of C++ Program - The Coding Shala
Home >> Learn C++ >> Basic Structure of C++ Program Basic Structure of the C++ Program The basic structure of the C++ program is as follows - C++ program can be simplified into two parts - first, writing a program in a text editor and save it with the correct extension. c++ program can be save with .cpp, .c, .cp extension . second, compiling your c++ program using a compiler or online IDE to check the output of your program. Let's look the below c++ code that will print ' Hello World ' as output - 1: //This is comment inline comment 2: /* This is also comment mulitine comment 3: C++ program to display "Hello World" 4: end of multiline comment */ 5: #include<iostream> // this include header file for input output functions 6: using namespace std; 7: // main function starts where the execution of program begins 8: int main() 9: { 10: cout<<"Hello World"; // pr...