Program to illustrate Function

  /*  Program to illustrate Function  */  
   
      #include<iostream.h>
      #include<conio.h>

    void function1 ( )
    {
        cout<<"\n I am in function1 ……";
    }
    void function2 ( )
    {
        cout<<"\n I am in function2 ……";
    }

    void function3 ( )
    {
        cout<<"\n I am in function3 ……";
    }
       void main( )
    { 
        cout<<"\n I am in main ……";
        function1 ( ) ;
        function2 ( ) ;
        function3 ( ) ;
        getch ( );
    }   
--------------------------------------------

/*  Program to illustrate Function  */
#include<iostream.h>
#include<conio.h>

void function3()
{
    cout<<"\n I am in function3 ……";
}


void function2()
{
    cout<<"\n I am in function2 ……";
    function3( );
}

void function1()
{
    cout<<"\n I am in function1 ……";
    function2();
    cout<<"\n I am back in function1 ……";
}


void main( )
{
    cout<<"\n I am in main ……";
    function1() ;
    cout<<"\n I am back in main ……";
    getch();
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|