I have a program that needs to return a value from a function. I have an output statement inside the function just to see what the output is, and it sems to work. However, upon returning the function value, it seems to always return false. It is a Boolean function. Can someone at least point me out to where I might look to understand what I am doing wrong?
Your condition is wrong. the number should not be divisible by 100.
But that's not the problem. The problem is that you have a global variable isLeap declared on line 7 which you're printing on line 32, but the variable to which you're assigning the return value of leap() is leapYear, declared on line 31.
Wow. Ok, I took a look at the code, and yes, I was addressing the wrong variables. After that, I found a few other errors, and corrected the incorrect !=100 math, and, now it works like expected. Thank you very kindly for pointing me in the right direction!