check weather you pass or fail in c
#include<stdio.h>
int main()
{
int Physics, Math, Chemistry;
float Total;
printf("Enter Physic markes\n");
scanf("%d", &Physics);
printf("Enter Math markes\n");
scanf("%d", &Math);
printf("Enter Chemistry markes\n");
scanf("%d", &Chemistry);
Total = (Physics + Math + Chemistry)/3;
if ((Total<40) || Physics<33 || Math<33 || Chemistry<33){
printf("Your total persentage is %f and You are Fail\n", Total);
}
else {
printf("Your total persentage is %f and You are Pass\n", Total);
}
return 0;
}
Comments
Post a Comment