The marks obtained by a student in 5 different subjects are Input through the Keyboard at the Run Time. The student gets a Division as per the given Rules:
Percent = (s1 + s2 +s3 + s4 + s5)*(100/500);
Statement of C Program: Write a program to Calculate the Division obtained by the Student:
#include<stdio.h>
#include<conio.h>
void main()
{
int s1 , s2 , s3 , s4 , s5 , Percent;
clrscr();
printf(" Enter marks of student in 5 subjects");
scanf(" %d%d%d%d%d" , &s1 , &s2 , &s3 , &s4 , &s5);
/* Percentage Formula = (Sum of Marks in 5 Subjects * 100)/ (Total Marks) */
if(percent>=60)
{
print(" First division\n ");
}
else /* percent<=60 */
{
if(percent>=50)
{
printf(" Second division\n " );
}
else /* percent<=50 */
{
if(percent>=40)
{
printf(" Third division\n ");
}
else /* percent<=40 */
{
printf(" Fail\n");
}
}
}
getch();
}
That's All
0 Response to "WAP to Calculate the Division of a Student as Per the given Rules of Tabel:"
Post a Comment