Write a program to calculate square root of a number using library function.
Answers
Answered by
0
Assuming that the answer has to be in C programming language, the solution code is as follows:
#include<stdio.h>
#include<math.h>
void main()
{
int n;
printf(""""Enter a number\n"""");
scanf(""""%f"""",&n);
n= sqrt(n);
printf(""""%f"""",n);
}
In C programming language, to find the square root of a number, we need to use sqrt() in-biult function.
The sqrt() method is located in the Math.h header file.
So, it's necessary to """"include"""" the Math.h header file in your program source code if you intend to use the sqrt() method.""
Answered by
0
hazrul najanuddin aulia and Amir khusro (deccani school)
Similar questions
Math,
7 months ago
History,
7 months ago
English,
7 months ago
Environmental Sciences,
1 year ago
Accountancy,
1 year ago
History,
1 year ago