answersLogoWhite

0

Progran code for square root in c language?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

/* 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

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Progran code for square root in c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the square root of raspberry?

The square root of raspberry is a "code" for cannabis.


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


What is the square root of square root's square root?

The 8th root


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 the square root of 4x?

We use the property of square roots that says the square root of (ab)=square root (a) multiplied by square root of b So square root (4x)=square root (4) mutiplies by square root of x =2(square root (x)) 2sqrt(x)


What is a principal square root?

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