Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- using namespace std;
- double squre_root(double S,int times){
- double x1;
- double x0=S/2;
- while(times>0){
- x1=(x0+S/x0)/2;
- x0=x1;
- times--;
- }
- printf("%f",x1);
- }
- int main()
- {
- double s = 400;
- int t = 10;
- squre_root(s,t);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement