Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Enter an integer array containing five integers, define the global variable max, and use the ismax custom function to calculate the maximum value.
Enter an integer array containing five integers, define the global variable max, and use the ismax custom function to calculate the maximum value.
# include & ltstdio.h & gt

int ismax(int a[])

{

int i,max

max = a[0];

for(I = 0; I<5; i++)

if(a[I]& gt; max)max = a[I];

Return to max

}

Master ()

{

int a[5],I;

Printf ("Enter 5 digits: \ n");

for(I = 0; I<5; i++)

scanf("%d ",& ampa[I]);

printf("the max:%d\n ",ismax(a));

}