Hello everyone, first of all i want to apologize for my poor english as it's not my first language
i want the average to show decimals but i don't know how
i know i'm missing something but i don't know what it is... any help would be appreciated
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include<stdio.h>
main()
{
int n=0,i=0,sum=0,n_grd=1,grd=0,avr=0;
printf("How many grades do you wish to evaluate? ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("Type grade number %d: ",n_grd);
scanf("%d",&grd);
sum+=grd;
n_grd++;
}
avr=sum/n;
printf("The average is: %d",avr);
return(0);
}