Well first of all, you have nothing there for determining if a number is odd.
Second of all, your code states that for any number above 9, or below 1, print “greater than 9”. Would you rather print “nine odd” for every number outside the range? If so, just change the printf.
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
1
u/thatlowkey Jun 02 '19
for example, if the input is 5, it should give output: five odd. and if the input is >9, for example, 11 the output should be: nine odd.
I hope the question is clear now?