Find out the average mark of n students.

Write a program find out the average mark of n students.

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

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

for(i=1; i<=n; i++)
{
printf("Mark for [ID %d]=", i);
scanf("%d", &mark);
sum=sum+mark;
}
avg=sum/n;
printf("Average =%.2f", avg);
}

Loading
Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Flying Twitter Bird Widget By ICT Sparkle