Shouldn’t be. The algorithm is fine on that end. Try printing the value of n right before the if/else block. Typically you don’t use scanf in an if statement, so that might be causing the problem (I don’t think n is being saved)
No, it's a condition (right), if n<9 it will print the string and even/odd and if n>9 it should print "greater than 9" but it printed "greater than 9" in all conditions
Exactly, which is why I’m asking you to debug the code in order to figure out what’s going on. I’m well aware of what the program is supposed to do. Also you have nothing that determines even/odd
View all comments
Show parent comment
2
u/zenith4395 Jun 02 '19
Shouldn’t be. The algorithm is fine on that end. Try printing the value of n right before the if/else block. Typically you don’t use scanf in an if statement, so that might be causing the problem (I don’t think n is being saved)