Skip to main content

The main() function

Main() function:
                                The main function indicates the beginning  of a c++ program. The statements within this function are the main body of the c++ program.If main() function is not included, the program is not compiled and an error message is generated.

syntax:

             main()
            {                 
                       
                        program statments........
           
             }



Comments

Post a Comment

Popular posts from this blog

Programs

PROGRAM 1: #include<iostream> using namespace std; int main() {    cout<<"HELLO WORLD";    return 0; } OUTPUT OF THE PROGRAM: HELLO WORLD                 ............................................................................................................................. PROGRAM 2: #include<iostream> using namespace std; int main() {    cout<<"c++ is best language";    return 0; } OUTPUT OF THE PROGRAM: c++ is best language      .............................................................................................................................                    

Writing c++ program

Introduction:                                       The source  code of a c++ program is stored on the disk with file extension cpp (cpp stands for  c plus plus) Structure of c++ programs:                                                       A c++ program consists of three main parts:  Preprocessor Directive     The main() function c++ statements Preprocessor Directives:                                         The instructions that are given to the compiler before the beginning of the actual program is called Preprocessor Directives also known  as compiler Directives Example:       ...