-------------------- -------------------- ----------------- for 10 if

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
//---------------------------------------------------------
1. for (i=0,s=0; i< 10; i++)
if (A[i]>s) s=A[i];
//---------------------------------------------------------
2. for (i=1,k=0; i< 10; i++)
if (A[i]>A[k]) k=i;
//---------------------------------------------------------
3. for (i=1,k=0; i< 10; i++)
if (A[i]<A[k]) k=i;
//---------------------------------------------------------
4. for (i=0,s=0; i< 10; i++)
if (A[i]<s) s=A[i];