Header Ads Widget

C program to receive marks of physics, chemistry & math's from user & check its eligibility for course

 

C program to receive marks of physics, chemistry & math's from user & check its eligibility for course 

Given marks of the subjects , Write a program to receive marks of physics, chemistry & math's 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 . 

Sample input
50 60 100   (Marks of Physics , chemistry and math's)

Sample Output
You are eligible for the course

C program to receive marks of physics, chemistry & math's from user & check its eligibility for course 

The objective of the code is to check the eligibility for the course .

Code(C):-
#include<stdio.h>
#include<math.h>
int main()
{
int phy,che,math,total,PM;
printf("Enter the marks of the physics chemistry and math's\n");
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 course\n");
}
else
printf("Not eligible\n");
return 0;
}

Output:-

Enter the marks of the physics chemistry and math's
50 60 100
You are eligible for the course




Recommended Post :-

HCL Coding Questions:-

Capgemini Coding Questions:-

Companies interview:-

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-