Function call : Pass by Value

#include<stdio.h>
#include<conio.h>
void main()
{
         int x[5],i;
         void display(int [],int);   
          clrscr();
          printf("\n Array Data \n");
        for(i=0;i<5;i++)
            scanf("%d",&x[i]);
       display(x,5);
       return;
}
void display(int a[],int n)
{
      int i=0;
     printf("\n Array Data \n");
  while(i<n)
   {
       printf("%5d",a[i]);
      i++;
    }
      return;
}

This is the output of the above program

Leave a comment

Design a site like this with WordPress.com
Get started