Program to illustrate Function


    #include<iostream.h>
    void fun ( )
    {
        cout<<"\n Welcome to the world of C++ ";
    }
    int main( )
    { 
        cout<<"\n Welcome to the world of Programming..";
        fun ( );
        return 0;
    }

---------------------------------------------

#include<iostream.h>
void  function( int b)
{
         b = 100 ;
         cout<<"\n value :" <<b;
}
void main( )
{
         int a = 50;
         function( a );
         cout<<"\n value : <<a;
}

--------------------------------------
#include<iostream.h>
void  function( int b)
{
         b = 100 ;
         cout<<"\n value :" <<b;
}
void main( )
{
         int a = 50;
     function(a);
     cout<<"\n=value : "<<a;
}


0 comments:

Post a Comment

 
 
 
 


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