+ 1
What's wrong with this code š¬š¬š¬š¬
#include <stdio.h> int main ( ) { int num; { printf ("enter marks between 1 to 100") ; printf ("\n 90") ; } if (num >=79) { printf ("distinction") ; } else if (num >= 60) { printf ("average") ; } return 0; }
1 Answer
+ 1
Read about taking input methods in c then check your code.
You don't have value in num or a garbage value..
edit:
Azure sample corrected code:
#include <stdio.h>
int main ( )
{
int num;
printf ("enter marks between 1 to 100") ;
scanf("%d",&num);
if (num >=79)
{
printf ("distinction") ;
}
else if (num >= 60)
{
printf ("average") ;
}
return 0;
}