Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //gcc 5.4.0
- #include <stdio.h>
- #include <math.h>
- #define error 0.000000001
- int main(void)
- {
- long long numero;
- long double raiz;
- scanf("%lld",&numero);
- raiz = numero / 2.0;
- while(fabs(numero -(raiz * raiz)) > error)
- {
- raiz = ((raiz / 2.0)+(numero /(2*raiz)));
- }
- printf("%Lf",raiz);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment