I have tried every possible test case which came to my mind yet I am not able to find even a signle case where my solution is returning wrong answer. Please help ?
Note that there was a confusion that my programme would not be able to detect the odd K and therefore will give output 0. But please note that the division of k is a float. So the temp will store 2.5 if K is 5, therefore either if or else-if block will be executed.
Hey @kauts_kanu thanks for yor ans, but the output to the above input coming 1 which is right ! Its happening cause I have a float division and so the value of temp will be 2.5 and not 2. So therefore the “else-if block” will be executed because 2 < 2.5 !
I hope u got what I meant !
@kauts_kanu, actually by-mistake, I linked to the previous file, the link is updated. And it’s giving 0 and 2 for the above-mentioned input!
And again thank you for the help!