/* Write a program to find out whether a student pass or fail.if it requires total 40%
and at least 33% in all subject to pass assume there is 3 subjects */
#include<stdio.h>
int main()
{
    float maths, sci, sst, total;        //float is the right choice 
    printf("enter your maths marks \n");
    scanf("%f",&maths);
    printf("enter your science marks \n");
    scanf("%f",&sci);
    printf("enter your sst marks \n");
    scanf("%f",&sst);
    total = (maths+sci+sst)/3;
    if(total<40 || maths<33 || sci<33 || sst<33){  // if there is 5 subjects then
      we divide this by 5 and 
    // Note: dont forget the brackets if we remove these then result is different 
        printf("you are fail and your percentage is %f",total);
    }
    else{
        printf("you are pass and your percentage is %f",total);
    }
    return 0;
} 
// thanks for watching  
// for more videos like this please subscribe this channel and please like this video 
// also comment if there is any problem in this video 
// again thanks 
// see you next time 
 


0 Comments