c programming for number average value

c programming for number average value

#include <stdio.h>
int main()
{
int n,avg, sum = 0;
int i;
int marks[30];
scanf("%d", &n);
for(i= 0; i <n; i++)
{
    printf("Enter the marks \n");
    scanf("%d", &marks[i]);
}
for(i = 0; i< n; i++)
{
    printf("\n marks = %d", marks[i]);
    sum= sum+ marks[i];
    avg = sum/n;
}
printf("\n Average marks = %d", avg);
}
Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment