mardi 30 janvier 2018

If condition not working in c.Else gets executed help ..for selecting club members

My if condition does not work. The command after else gets executed and not the if condition pls help i have tried everything

 #include <stdio.h>

main()
{
   int class;
   float grade;

   printf("Enter your class and grade");
   scanf("%d%f",&class,&grade);

   if((class==10)||(class==8 && grade>=80)||(class==9 && grade>=70))
       {
         printf("You can sign up for MUN");
       }
       else
       {

         printf("You cant sign u!");
       }


}

Aucun commentaire:

Enregistrer un commentaire