prev


for loop

120. Position of Biggest of 10 nos - integer array(03.08.2010)

/*
Program# 120
date : 14-01-2009
Position of Biggest of 10 nos - integer array
*/

#include <stdio.h>
main(){
int i,a[10],pos;
pos=0;
for(i=0;i<10;i++)
scanf("%d",&a[i]);
for(i=0;i<10;i++){
pos=(a[i]>a[pos])?i:pos;
}
printf("\n %d",pos);
}



next
blog comments powered by Disqus