若数组a中有十个整数8,2,5-3,7,-9,0,-4,10,15,请编程求出该数组中的最大值和最小值.(用C语言)

来源:学生作业学帮网 编辑:学帮网 时间:2024/06/05 11:25:18

若数组a中有十个整数8,2,5-3,7,-9,0,-4,10,15,请编程求出该数组中的最大值和最小值.(用C语言)

#include
void main()
{int i,max,min,a[ ]={8,2,5,-3,7,-9,0,-4,10,15};
max=min=a[0];
for(i=0;i