AD4BP

Program:-15

Program:-15

Aim:-Write program for enter marks of five subject & find class of given percentage.
Input:-
#include< stdio.h >
#include< conio.h >
void main( )
{
int a,b,c,d,e;
float p;
clrscr( );

printf("Enter marks of Maths:");
scanf("%d",&a);

printf("Enter marks of Phy:");
scanf("%d",&b);

printf("Enter marks of Che:");
scanf("%d",&c);

printf("Enter marks of English:");
scanf("%d",&d);

printf("Enter marks of Computer:");
scanf("%d",&e);

p=(a+b+c+d+e)*100/500;

printf("Percentage: %5.2f%\n",p);

if(p<=100 &&p>=70)
{
printf("Destiction");
printf("\nCongratulation");
}
else if(p<70 &&p>=60)
{
printf("First class");
printf("\nCongratulation");
}

else if(p<60 &&p>=50)
{
printf("Second class");
printf("\nCongratulation");
}

else if(p<50 &&p>=35)
{
printf("Third class");
printf("\nCongratulation");
}

else if(p<35)
{
printf("Fail");
}

else
{
printf("Check your Entery");
}

printf("\nThank you \n Bye");
getch( );
}
Output:-