You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
426 B
C

5 years ago
#include<stdio.h>
void main()
{
void max();
max();
}
void max()
{
int a[5],max,n,i;
printf("How many nos you want to enter: ");
scanf("%d",&n);
printf("Enter element for the array: ");
for(i=0; i<n; i++)
scanf("%d",&a[i]);
max=a[0];
for(i=1; i<5; i++)
{
if(max<a[i])
max=a[i];
}
printf("maximum no= %d",max);
}