C program for average of 10 numbers
void main()
{ int i,n,sum=0;
float avg;
clrscr();
printf("enter the 10 number\n");
for (i=1;i<=10;i++)
{
scanf("%d",&n);
sum +=n;
}
avg=sum/10.0;
printf("The sum of 10 no =%d\nThe Average of = %8.2f\n",sum,avg);
getch();
}
you can post your output in comment box...
{ int i,n,sum=0;
float avg;
clrscr();
printf("enter the 10 number\n");
for (i=1;i<=10;i++)
{
scanf("%d",&n);
sum +=n;
}
avg=sum/10.0;
printf("The sum of 10 no =%d\nThe Average of = %8.2f\n",sum,avg);
getch();
}
you can post your output in comment box...
Comments
Post a Comment