#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int hindi,english,maths,total,percent;
cout<<"enter hindi marks ";
cin>>hindi;
cout<<"enter english marks ";
cin>>english;
cout<<"enter maths marks ";
cin>>maths;
total= hindi + english + maths;
cout<<"total is "<<total<<endl;
percent = total/3; /*switch case can not be used for conditions*/
if(percent >= 90 && percent <=100)
{ cout<<"Excellent "; }
else if(percent >= 80 && percent <= 89)
{cout<<"A+ "; }
else if(percent >= 70 && percent <= 79)
{cout<<"A "; }
else if(percent >= 60 && percent <= 69)
{ cout<<"B+ "; }
else if(percent >= 50 && percent <= 59)
{cout<<"B "; }
else if(percent >= 40 && percent <= 49)
{ cout<<"C "; }
else if(percent >= 0 && percent <= 39)
{cout<<"F "; }
getch();
}
#include<conio.h>
void main()
{
clrscr();
int hindi,english,maths,total,percent;
cout<<"enter hindi marks ";
cin>>hindi;
cout<<"enter english marks ";
cin>>english;
cout<<"enter maths marks ";
cin>>maths;
total= hindi + english + maths;
cout<<"total is "<<total<<endl;
percent = total/3; /*switch case can not be used for conditions*/
if(percent >= 90 && percent <=100)
{ cout<<"Excellent "; }
else if(percent >= 80 && percent <= 89)
{cout<<"A+ "; }
else if(percent >= 70 && percent <= 79)
{cout<<"A "; }
else if(percent >= 60 && percent <= 69)
{ cout<<"B+ "; }
else if(percent >= 50 && percent <= 59)
{cout<<"B "; }
else if(percent >= 40 && percent <= 49)
{ cout<<"C "; }
else if(percent >= 0 && percent <= 39)
{cout<<"F "; }
getch();
}