Aim - Calculate The Sum & Percentage Of Marks Obtained In 5 Subject
Code-
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e;
float sum, per;
clrscr();
printf("Enter The Marks In Five Subjects Respectively\n");
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
sum = a+b+c+d+e;
per = (sum / 5);
printf("\n\nThe Sum Of The Marks Obtained Is \t%f",sum);
printf("\n\nThe Percentage is \t%f",per);
getch();
}
OUTPUT
Enter The Marks In Five Subjects Respectively
56 65 98 78 74
The Sum Of The Marks Obtained Is 371.000000
The Percentage Is 74.20000
No comments:
Post a Comment