#include <stdio.h>
#define N 10
main()
{
int count;
float sum, average, number;
sum =0;
count =0;
while( count <>
{
scanf( "%f",&number);
sum = sum + number;
count = count + 1;
}
average = sum/N ;
printf("N = %d Sum = %f", N, sum);
printf(" Average = %f", average);
return 0;
}
Output:
1
2.3
4.67
1.42
7
3.67
4.08
2.2
4.25
8.21
N = 10 Sum = 38.799999 Average = 3.880000
0 comments:
Post a Comment