Error in code to compute square root

For larger numbers the number of precision places is not as much as the inputted value. This is the code: https://ide.codingblocks.com/s/125731

The case I considered was n=36278 and p=6

@shruthi019 replied to your similar post please don’t create multiple
thank you