answersLogoWhite

0

/* program to find Square Root of a given number. */ #include #include double Abs(double Nbr) { if( Nbr >= 0 ) return Nbr; else return -Nbr; } double SquareRoot(double Nbr) { double Number = Nbr / 2; const double Tolerance = 1.0e-7; do Number = (Number + Nbr / Number) / 2; while( Abs(Number * Number - Nbr) > Tolerance); return Number; } int main() { double Number ; double Nbr; clrscr(); printf("\n Enter any number:"); scanf("%lf",&Number); Nbr=SquareRoot(Number); printf("The square root of %.2lf is %.2lf", Number,Nbr); getch(); }

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How is the square root sign used in pseudo code?

Usually, in code, the square root symbol is denoted as: sqrt() where the number inside the square root is written inside the brackets. For example, if you wanted the square root of 64, write: sqrt(64)


How to get the square root of 2?

Please tell me in which computer language you want the answer.


You want vhdl code for finding square root of binary number?

yes


What is the square root of the square root of 2?

The square root of the square root of 2


Some irrational numbers?

square root of (2 ) square root of (3 ) square root of (5 ) square root of (6 ) square root of (7 ) square root of (8 ) square root of (9 ) square root of (10 ) " e " " pi "


Irrational numbers between 2 and 2.5?

There are infinitely many of them. They include square root of (4.41) square root of (4.42) square root of (4.43) square root of (4.44) square root of (4.45) square root of (5.3) square root of (5.762) square root of (6) square root of (6.1) square root of (6.2)


What is the square root of a square that has no root?

It's not a square if it has no root. If a number is a square then, by definition, it MUST have a square root. If it did not it would not be a square.


Square root 2 times square root 3 times square root 8?

square root 2 times square root 3 times square root 8


What is a principal square root?

The principal square root is the non-negative square root.


What is the difference between principal square root and perfect square root?

A principal square root is any square root that's answer is positive, and a perfect square root is a square root that's answer is an integer.


What is the square root of 20 in simplest form?

square root of 20 = square root of 4 * square root of 5. square root of 4 = 2, so your answer is 2 square root of 5.


Simplify square root of 5 Times Square root of 6?

To simplify the square root of 5 times the square root of 6, you can multiply the two square roots together. This gives you the square root of (5*6), which simplifies to the square root of 30. Therefore, the simplified answer is the square root of 30.