Paisen

do_while3

Sep 20th, 2020
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. double a,b=0,c=0;
  4.  
  5. int main (){
  6.     printf("introduce el numero a sacar raiz\n");
  7.     scanf("%lf",&a);
  8.     b=a;
  9.     c=a/b;
  10.     do{
  11.     b=(0.5*((a/b)+b));
  12.     c=a/b;
  13.     }while(b!=c);
  14.  
  15.  
  16. printf("\nLa raiz de este numero es: %lf",b);
  17.     return 0;
  18.    
  19.     }
Add Comment
Please, Sign In to add comment