Home
About Us
Contact Us
Privacy Policy
Home
Programs
_C Programs
_C++ Programs
_Python Programs
Operations on Data
_Searching
Projects
_Python
About Us
Contact Us
Privacy Policy
Home
C Program
C Program To Calculate Percentage of 5 Subjects
C Program To Calculate Percentage of 5 Subjects
Coding PLEX
January 06, 2022
PROGRAM :
main.c
#include
<stdio.h>
int
main
()
{
int
a
,
b
,
c
,
d
,
e
,
sum
,
t
;
float
per
,
per1
;
printf
(
"Enter the marks of 5 subject
\n
"
);
scanf
(
"%d%d%d%d%d"
,&
a
,&
b
,&
c
,&
d
,&
e
);
printf
(
"
\n
Enter the Total Marks
\n
"
);
scanf
(
"%d"
,&
t
);
sum
=
a
+
b
+
c
+
d
+
e
;
per
=
sum
*
100
;
per1
=
per
/
t
;
printf
(
"
\n
Marks Obtained = %d / %d
\n
"
,
sum
,
t
);
printf
(
"
\n
Percentage = %.2f"
,
per1
);
}
#include
int main() { int a,b,c,d,e,sum,t; float per,per1; printf("Enter the marks of 5 subject \n"); scanf("%d%d%d%d%d",&a,&b,&c,&d,&e); printf("\nEnter the Total Marks\n"); scanf("%d",&t); sum = a+b+c+d+e; per = sum*100; per1 = per/t; printf("\nMarks Obtained = %d / %d\n",sum,t); printf("\nPercentage = %.2f",per1); }
Copy
OUTPUT :
Enter the marks of 5 subject
90
80
95
97
96
Enter the Total Marks
500
Marks Obtained = 458 / 500
Percentage = 91.60
Post a Comment
0 Comments
Featured Post
QR Code Generator
QR Code Generator Application in Python Using Kivy Module - Beginner's Python Project For Students
Coding PLEX
January 21, 2022
Here is the Complete Code For the QR Code Generator Application in Python Using Kivy …
Popular Posts
Social Plugin
Labels
C Program
18
Python Program
11
Projects
8
Python Turtle Arts
5
C++ Program
3
Games
1
0 Comments