samedi 25 septembre 2021

c program if else if statement

facing problem in second and third else if statement. when i run the code it shows the printf statements of first if and first else if statement except for its own printf statements.how to solve it please help anyone

#include <stdio.h>

int main()

{
int sci_score, maths_score;

printf("enter your sci score:", sci_score);

scanf("%d", &sci_score);

printf("enter your maths score:", maths_score);

scanf("%d", &maths_score);

if(sci_score>=33, maths_score>=33) 
{
    printf("you are awarded with ruppees 45");
}

else if(sci_score>=33, maths_score<33)
{
    printf("you are awarded with ruppees 15. work hard in maths");
}

else if(sci_score<33, maths_score>=33)
{
    printf("you are awarded with ruppees 15. work hard in sci");
}

else if(sci_score<33, maths_score<33) 
{
    printf("work hard in sci and maths");
}

return 0;

}

Aucun commentaire:

Enregistrer un commentaire