in tis code ye ak step back kyo jye rhe h
Square root basic approach
you are finding the square root at decimal level.
so you will come out of the loop:
while(ans x ans <=n) (note: x is multiplication)
ans = ans+inc;
only when condition becomes false. it means ans x ans becomes > n. but if i do
ans = ans - inc. which is last iteration of while loop when condition was true. then ans x ans would be <=n, which we need before going into next iteration of times.
thanks.