[ create a new paste ] login | about

Link: http://codepad.org/5qGWOIK2    [ raw code | output | fork ]

zViXz - C, pasted on May 17:
1
2
3
4
5
6
7
8
9
10
11
#include <stdio.h>

main ()
{
int a[10] = {1, 15, 7, 5, 6, 12, 16, 31, 31, 25}, T=15, result=-1, i, size=10;
for (i=0; i<size; i++)
{
if (a[i]>=T) {T=a[i]; result=i;}
}
printf ("%d", result);
}


Output:
1
8


Create a new paste based on this one


Comments: