Find out the average mark, number of N students using array.

Find out the average mark, number of N students using array.

Program:
#include<stdio.h>
main()
{
int n, i, sum=0, m[50];
float avg;

printf("Enter students: N= ");
scanf("%d", &n);

i=0;
while(i<n)
{
printf("Enter mark for [id %d]= ", i);
scanf("%d", &m[i]);

sum=sum+m[i];
i++;
}
avg=sum/n;
printf("Avarage=%.2f", avg);
}

Loading
Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Flying Twitter Bird Widget By ICT Sparkle