+ 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; }

4th Jan 2022, 3:04 PM
Azure
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; }
4th Jan 2022, 5:24 PM
Jayakrishna šŸ‡®šŸ‡³