AIM:A program to test the student is passed with first class(or) second class(or) third class(or)the student is fail.
PROGRAM:
#include<stdio.h>
main()
{
int sno,m1,m2,m3,total;
printf("enter the values of sno,m1,m2,m3");
scanf("%d%d%d%d",&sno,&m1,&m2,&m3);
total=m1+m2+m3;
if((m1>=35)&&(m2>=35)&&(m3>=35)&&(total>=180))
printf("the student is passed with first class");
else
if((m1>35)&&(m2>35)&&(m3>=35)&&(total>=150)&&(total<=180))
printf("the student is passed with second class");
else
if((m1>=35)&&(m2>=35)&&(m3>=35)&&(total>=105)&&(total<=150))
printf("the student is passed with third class");
else
printf("the student is fail");
}
OUTPUT:
enter the values of sno,m1,m2,m3
408
78
60
50
the student is passed with first class
No comments:
Post a Comment