Program to illustrates Passing Array Elements to a Function (Call by Value)


    #include<iostream.h>
    #include<conio.h>
    void show( int ) ;
    void main( )
    {
        int number[ ]= { 11, 22, 33, 44, 55 } ;
        for( int i = 0; i <= 4; i++)
           show(number[i]);   //passing element of an array to the function
        getch( );
    }
        void show(int x)
    {
          cout<<"\t"<<x;
    }

0 comments:

Post a Comment

 
 
 
 


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