What is the algorithm for average of three numbers?

1 answer

Answer

1130067

2026-08-03 04:25

+ Follow

int secondmax (int a[], int n)

{

int i, max, second;

for (i=0; i

if (i==0 a[i]>max) second= max, max= a[i];

else if (i==1 a[i]>second) second= a[1];

}

return second;

}

int middle (int a[3])

{

return secondmax (a, 3);

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.