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

Popular posts from this blog

create a num table in a new file in c

write a programme to compare time stamp in c

write a struct programme to keep bank details in c