Admission to a professional course is subject to the following conditions: a. Marks in Mathematics >=60 b. Marks in Physics >=50 c. Marks in Chemistry >= 40 d. Total in all three subjects >= 200 or Total in mathematics and physics >=150 Given the marks in three subjects, write a program to process the applications to list the eligible candidates

#include<stdio.h>
#include<conio.h>
#include<math.h>
struct student
{
    int roll,p,c,m;
};

main()
{
    clrscr();
    int i;
    struct student stu[3];
    for(i=0;i<=2;i++)
    {
        printf("Please Enter the roll:= ");
        scanf("%d",&stu[i].roll);
        printf("Please Enter the marks of Mathematics:= ");
        scanf("%d",&stu[i].m);
        printf("Please Enter the value of Physics:= ");
        scanf("%d",&stu[i].p);
        printf("Please Enter the value of Chemistry:= ");
        scanf("%d",&stu[i].c);

    }

    for(i=0;i<=2;i++)
    {
        if(stu[i].m>=60 && stu[i].p>= 50 && stu[i].c>= 40 && ((stu[i].m+stu[i].p+stu[i].c>=200) || (stu[i].m+stu[i].p>=150)))
            printf("\n%d   PASS",stu[i].roll);
        else
            printf("\n%d   FAIL",stu[i].roll);
    }

    getch();
}
Next Post Previous Post
No Comment
Add Comment
comment url