Hey lads.
Basically am going a bit insanse so am kinda hoping someone can help me out. Basically I need to create a program in C# that allows the user to enter a number that they want to find the square root off and then enter there approximation.
From this the following formula is used. new = (old + x/old) / 2. So for example if I wanted to find the square root of 25 and I put in an approximation off 7 then new would be new = (7 + 25/7) / 2. Therefore new would then = 5.2857. This would then be used for the next iteration - new = (5.2857 + 25/5.2857) /2.
This process then needs to be repeated until the number is within ±0.00000005 of the actual answer which I know how to do. Each iteration needs to be wrote to a text box. I no its going to be a Do/While loop with the While condidtion being to stop when the number is within ± 0.00000005 of the actual Square Root. So it would be 5 in this case. I just don't know how to do this.
Chears to anyone who can help.
Basically am going a bit insanse so am kinda hoping someone can help me out. Basically I need to create a program in C# that allows the user to enter a number that they want to find the square root off and then enter there approximation.
From this the following formula is used. new = (old + x/old) / 2. So for example if I wanted to find the square root of 25 and I put in an approximation off 7 then new would be new = (7 + 25/7) / 2. Therefore new would then = 5.2857. This would then be used for the next iteration - new = (5.2857 + 25/5.2857) /2.
This process then needs to be repeated until the number is within ±0.00000005 of the actual answer which I know how to do. Each iteration needs to be wrote to a text box. I no its going to be a Do/While loop with the While condidtion being to stop when the number is within ± 0.00000005 of the actual Square Root. So it would be 5 in this case. I just don't know how to do this.
Chears to anyone who can help.