write a c program which reads the marks of a student in physics,chemistry,and mathemaics,and stores them in integer variables p,c,m.The program should print (Eligible/Not Eligible) based on the following eligibility criteria for admission to a degree course:
Marks in Maths >=65
Marks in Phy >=55
Marks in Chem>=50
Total in all three subject>=190
or
Total in Math and Physics>=140
#include <iostream>
using namespace std;
int main()
{
int p,c,m;
cout<<"Marks in Physics: ";
cin>>p;
cout<<"Marks in Maths: ";
cin>>m;
cout<<"Marks in Chemistry: ";
cin>>c;
if ((m >= 65 and p >= 55 and c >= 50 ) and ((p+c+m >= 190) or (m+p >= 140)))
{
cout<<"Eligible";
}
else
{
cout<<"Not Eligible";
}
}
Comments
Leave a comment