write a basic program to accept the name of a student, his marks in four subjects and print their average
Answers
Answered by
1
#include<stdio.h>
void main()
{
int sum,m1,m2,m3,m4;
float avg;
char s[100];
printf("Enter Student Name\n");
scanf("%s",&s);
printf("Enter Marks of the Student\n");
scanf("%d %d %d %d",&m1,&m2,&m3,&m4);
sum=m1+m2+m3+m4;
avg=sum/4;
printf("Average = %f\n",avg);
getch();
}
Similar questions