#include<stdio.h>
#include<conio.h>
int main()
{
int m1,m2,m3,m4,m5,t;
float avg;
printf("Enter the marks of sub 1: ");
scanf("%d",&m1);
printf("Enter the marks of sub 2: ");
scanf("%d",&m2);
printf("Enter the marks of sub 3: ");
scanf("%d",&m3);
printf("Enter the marks of sub 4: ");
scanf("%d",&m4);
printf("Enter the marks of sub 5: ");
scanf("%d",&m5);
t=m1+m2+m3+m4+m5;
avg=(float)t/5.0;
printf("The total is %d and average is %f.",t,avg);
if(avg>=80)
printf("\nThe grade is A..");
else if(avg>=70)
printf("\nThe grade is B..");
else if(avg>=60)
printf("\nThe grade is C..");
else if(avg>=50)
printf("\nThe grade is D..");
else if(avg>=40)
printf("\nThe grade is E..");
else
printf("\nThe grade is F..");
getch();
return 0;
}
#include<conio.h>
int main()
{
int m1,m2,m3,m4,m5,t;
float avg;
printf("Enter the marks of sub 1: ");
scanf("%d",&m1);
printf("Enter the marks of sub 2: ");
scanf("%d",&m2);
printf("Enter the marks of sub 3: ");
scanf("%d",&m3);
printf("Enter the marks of sub 4: ");
scanf("%d",&m4);
printf("Enter the marks of sub 5: ");
scanf("%d",&m5);
t=m1+m2+m3+m4+m5;
avg=(float)t/5.0;
printf("The total is %d and average is %f.",t,avg);
if(avg>=80)
printf("\nThe grade is A..");
else if(avg>=70)
printf("\nThe grade is B..");
else if(avg>=60)
printf("\nThe grade is C..");
else if(avg>=50)
printf("\nThe grade is D..");
else if(avg>=40)
printf("\nThe grade is E..");
else
printf("\nThe grade is F..");
getch();
return 0;
}
No comments:
Post a Comment
Convey your thoughts to authors.