Explanation of each section of the program

  • Preprocessor Directive - In this section we telling the compiler to preprocessed code from included header file. In our case iostream which contains all essential functions we can use like cout.

  • Main Function - It’s entry point of the program. In main we use defined or declared elements e.g header files or our own functions. Without it program will not run.

  • Expression Statements - An expression statements are simply an expressions followed by a semicolon.

  • Declaration Statements - Declaration Statements are declarations of e.g the variable.

  • Return Statement - It returns value 0 to the main function. The return 0 means success and returning a non-zero number means failure.

Privacy & Terms