RE: How do we get Square root of any number Without us...
You can use a iterative method for example bisection
#include <stdio.h> main() { int n; float eval 1.0 x1 0 x2 n x; //trying to locate root between x1 0 and x2 n and giving a initial dummy value to eval x (x1+x2)/2; printf( Enter value for n n n ); scanf( d &n); while((eval > 0.0001 )||( eval < -0.0001) ) { //you can change accuracy by changing 0.0001 to smaller value eval x*x-n; printf( eval f t eval); //printf to keep track not necessary if(eval>0){ x2 x; x (x2+x1)/2 ; printf( x f t x); //printf to keep track not necessary } else { x1 x ; x (x1+x2)/2 ; printf( x f t x); //printf to keep track not necessary } printf( n n ); } printf( the root is f x);
RE: How do we get Square root of any number Without us...
#include
main()
{
int a 5;
int b a**a;
printf( d b);
}
I hope the above program would work under Unix. It is not working in Turbo C. If anything wrong in this program please let me know about that through my email.