Monday 27 August 2012

Max Array examples in c program | c program array

 Array max code , Example

Array max code
#include<stdio.h>
int max(int a[]);
void main()
{
  int a[10],i,ans;
  clrscr();
  printf("\nEnter 10 elements in array:");
  for(i=0;i<10;i++)
  scanf("%d",&a[i]);
  ans=max(a);
  printf("\n Max element of array:%d",ans);
  getch();
}
int max(int a[])
{
  int j,m=0;
  for(j=0;j<10;j++)
  {
    if(a[j]>m)
    m=a[j];
  }
  return(m);
code for Array max
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: