#include<stdio.h>
void main()
{
int i,a[20],max,n;
printf("Enter no of elements\n");
scanf("%d",&n);
printf("Enter the array\n");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
max=a[0];
for(i=1;i<n;i++)
{
if(a[i]>max)
max=a[i];
}
printf("Max Element=%d",max);
}
No comments:
Post a Comment