For your code, I have no idea why there is so much going on there just to check if number is even. You cannot simply convert a double to int and proceed like the decimal didn't exist. Also consider that the number may not fit inside int datatype.
The OP solved the kata by the way, so I'll close the question.
use long int instead of int
For your code, I have no idea why there is so much going on there just to check if number is even. You cannot simply convert a
double
toint
and proceed like the decimal didn't exist. Also consider that the number may not fit insideint
datatype.The OP solved the kata by the way, so I'll close the question.
@HammadAli132: How do you know? There isn't even a language mentioned or which test isn't passing.
Rest assured that the tests are correct.
Same issue with me. But, don't worry as youv'e done correct.
This comment is hidden because it contains spoiler information about the solution
Your loop has a bug.
not a kata issue.