I saw some one write this code
int r, odd_divisors(int a, int b) {
r = sqrt(b) + 1;
r -= sqrt(a);
}
AFAIK, the compiler will automatically add return 0;
at the end of this code, but in this case, it returns the value of r
. Could someone please help me to explain why this happen. Thanks.
UPDATE:
This function actually works in this Codefights site: https://codefights.com/challenge/eu4zLJDcv88B2mcCp. You can check for sir_ementaler
's solution.
UPDATE 2: Thanks for everyone that pointed out this function is ill format. I knew that. The reason I asked here is because it is the winner's solution in the site I mentioned in the previous update. It looks to me that Codefights must add some other feature to their compiler.