prev


for loop

118. Mean of 10 nos - integer array (03.08.2010)

/*
Program# 118
date : 14-01-2009
Mean of 10 nos - integer array
*/

#include <stdio.h>
main(){
int i,s,a[10];
float mean;
mean=0.0;
s=0;
for(i=0;i<10;i++)
scanf("%d",&a[i]);
for(i=0;i<10;i++)
s+=a[i];
mean=(float)s/10.0;
printf("\nMean : %f",mean);
}



next
blog comments powered by Disqus