Write a program in C to find the student’s eligibility for admission into some academic program. Ask the user to enter three grades for Maths, Physics, and Chemistry. Then if: The student’s grade in Math is greater than 80 and in Physics is greater than 70, the student is eligible to study Engineering. The student’s grade in Physics is greater than 80 or Chemistry is greater than 90, the student is eligible to study Sciences. Otherwise, the student is not eligible to study in this college.
Code:
#include<stdio.h>
int main()
{
int maths,phy,chem;
printf("\nEnter the Maths marks (out of 100):");
//input maths marks
scanf("%d",&maths);
printf("\nEnter the Physics marks (out of 100):");
//input physics marks
scanf("%d",&phy);
printf("\nEnter the Chemistry marks (out of 100):");
//input chemistry marks
scanf("%d",&chem);
printf("\nEntered marks:\n
Maths:%d\tPhysics:%d\tChemistry:%d",maths,phy,chem);
if((maths>80)&&(phy>70)) //checking
condition 1
printf("\nYou are eligible to study
Engineering....");
else if((phy>80)||(chem>90))
printf("\nYou are eligible to study
Sciences...."); //checking condition 2
else
//if both not satisfied
printf("\nYou are not
eligible to study in this college..!");
}
Output:
1)
2)
3)
Get Answers For Free
Most questions answered within 1 hours.