Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Define an integer array, find the sum of the array elements, the maximum and minimum values of the array elements, and output the resulting knot.
Define an integer array, find the sum of the array elements, the maximum and minimum values of the array elements, and output the resulting knot.
# include & ltstdio.h & gt

void main()

{

int a[ 10]={2,3,5, 1,8,4,7,9,0,6 };

int i,s;

int max,min

max = min = a[0];

for(I = s = 0; I< 10; i++)

{

s = s+a[I];

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

if(a[I]& lt; min)min = a[I];

}

printf("%d %d %d ",s,max,min);

}