I have to write a script in C where the sqrt of an positive number is calculated using nested intervals and call by reference (no structs or math.h allowed)
I tried for like 5 days but I'm kina depressed now. Can anyone help?
I have to write a script in C where the sqrt of an positive number is calculated using nested intervals and call by reference (no structs or math.h allowed)
I tried for like 5 days but I'm kina depressed now. Can anyone help?
Copyright © 2021 Jogjafile Inc.
I can show you how to calculate the square root of 5. From there you'll know what to do: First, you know that the square root of a number is generally smaller than the number itself, so you start with the interval [0,5], and you calculate the middle (which is 2.5, whose square is 6.25. So, the square root of 5 should be between 0 and 2.5. So you get: