enter the marks of students and find their sum and avarage

#include<stdio.h>
#include<conio.h>
int main()
{
	int i,num,sum=0,hmarks;
	int arr[20];
	float avg;
	printf("\nenter the number of students :");
	scanf("%d",&num);
	printf("\nenter the marks of the students\n");
	for(i=0;i<num;i++)
	{
		scanf("\n%d",&arr[i]);
		sum=sum+arr[i];
	}
	printf("\ntotal marks of students :%d",sum);
	avg=sum/num;
	printf("\naverage marks of the students :%f",avg);
	for(i=0;i<num;i++)
	{
		
	}
	return 0;
}

Leave a comment