Write a program to receive marks of physics, chemistry & maths from user & check its eligibility for course if a) Marks of physics > 40 b) Marks of chemistry > 50 c) Marks of math’s > 60 d) Total of physics & math’s marks > 150 or e) Total of three subjects marks > 200

 Code:-

#include<stdio.h>
#include<math.h>
int main()
{
int phy,che,math,total,PM;
printf(“Enter the marks of the physics chemistry and math’sn”);
scanf(“%d%d%d”,&phy,&che,&math);
total=(phy+che+math);
PM=phy+math;
if(phy>40 && che>50 && math>60 && (PM>150||total>200))
{
printf(“You are eligible for the coursen”);
}
else
printf(“Not eligiblen”);
return 0;
}

Output:-

Enter the marks of the physics chemistry and maths
50 60 100
You are eligible for the course

Recommended Post:-

         MCQs:-







Leave a Reply

Your email address will not be published.