Ticker

6/recent/ticker-posts

Sum and Average of Marks calculation by using Array

 

Sum and average of Marks by using Array
Sum and average of Marks by using Array



#include<stdio.h>
#include<conio.h>

void main()
{
	int n,i,sum=0,marks[50];
	float avg;
	printf("\nEnter the number of students :	");
	scanf("%d",&n);
	
	for(i=0;i<n;i++)
	{
		printf("\nEnter the student Marks	:	");
		scanf("%d",&marks[i]);
		sum = sum + marks[i];
	}
		printf("\nThe sum of the Student Marks are  %d",sum);
		avg = (float)sum/n;
		printf("\nThe Average Student Mark is  %.2f",avg);
		
		getch();
}
		

Post a Comment

0 Comments