#include<stdio.h>
void main()
{
int number1,number2,number3;
float average;
int sum=0;
for(number3=1;number3<=7;number3++)
{
printf("Enter the number:");
if(scanf("%d",&number1)==1)
{
sum=sum+number1;
average=sum/number3;
printf(" The sum :%d\t The average:%f\n",sum, average);
}
else
{
printf("Error,Enter the correct number.");
}
}
printf("\nThe aggregate average is:%6.2f",average);
}
=========================================OUTPUT====================================
Enter the number:23
The sum :23 The average:23.000000
Enter the number:45
The sum :68 The average:34.000000
Enter the number:76
The sum :144 The average:48.000000
Enter the number:34
The sum :178 The average:44.000000
Enter the number:29
The sum :207 The average:41.000000
Enter the number:30
The sum :237 The average:39.000000
Enter the number:966
The sum :1203 The average:171.000000
The aggregate average is:171.00