Code not running properly on the ide, but true on my system

the code is working properly on my system but working improperly on the coding blocks problem submission or on the ide also.
problem name - Kth Root
my solution link - https://ide.codingblocks.com/s/85633
ide output - https://gyazo.com/c9075253251ecfa97b5e4f02e1e0ec47

my system output - https://gyazo.com/26f705f5b8f5b8616282f434a5b70ce3

the program is creating problem after the line 58206 is printed in the output.
actually, it should not be printed because the it should return false due to the if condtion…
please expain…incorrect output***

hey @sirraghavgupta, there is one more case when mid ^ k is equal to n, in which you just have to make ans=mid and directly break from the while loop.
Consider that case also, in case got any problem feel free to ask here.