see

A

WAP to take ‘n’ numbers as input and save it in an array and pass entire array to a function, which finds largest number, using pointers


WAP to take ‘n’ numbers as input and save it in an array and pass entire array to a function, which finds largest number, using pointers
#include<stdio.h>
#include<conio.h>
void max(int a[]);
void main()
{
  int a[20],i,d,j,k;
  clrscr();
  for(i=1;i<=5;i++)
  {
    scanf("%d",&d);
    a[i]=d;
  }
  max(a);
  //printf("%d",j);
  getch();
  }
void max(int a[])
  {  int i,e=0;
     for(i=1;i<=5;i++)
     {
      if(a[i]>e)
      {
       e=a[i];
      }
     }
      printf("%d",e);

  }


Copyright © 2013. BloggerSpice.com - All Rights Reserved
Customized by: MohammadFazle Rabbi | Powered by: BS
Designed by: Tilabs