C Program to Find Total, Percentage and Division of Student

0
15
digitalample eye
Write a c program to find take five subjects number and calculate total, percentage, and division of that student.

Write a program to find the division of a student by asking 5 subjects numbers

Write a program to find Total and percentage by entering 5 subject marks of student

C Code

#include <stdio.h>
#include <conio.h>
void main()
{
int sub1, sub2, sub3, sub4, sub5, total;
float per;

printf("Enter marks of 5 subjects:");
scanf("%d%d%d%d%d",&sub1,&sub2, &sub3, &sub4, &sub5);

total = sub1+sub2+sub3+sub4+sub5;
per = total/5;

printf("nTotal Marks: %d",total);
printf("nTotal Percentage: %f", per);

if(per>=80)
printf("nDistinction");
else if(per>=60)
printf("nFirst Division");
else if(per>=50)
printf("nSeocnd Division");
else if(per>=40)
printf("nThird Division");
else
printf("nFail");
getch();
}

Output

Result Calculation

LEAVE A REPLY

Please enter your comment!
Please enter your name here