C++ grade system program
#include <iostream>
using namespace std;
int main()
{
int m1,m2,m3,avg;
cout<<"enter the marks";
cin>>m1>>m2>>m3;
avg=(m1+m2+m3)/3;
if(avg>=75)
{cout<<"A+ with distinction";}
else if(avg>=60 && avg<75)
{cout<<"grade is A";}
else if(avg>=45 && avg<60)
{cout<<"grade is B";}
else if(avg>=40 && avg<45)
{cout<<"grade is C";}
else
{cout<<"grade is f";}
}
Comments
Post a Comment