#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();
}
#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();
}
No comments:
Post a Comment