Computer Science, asked by TbiaSamishta, 1 year ago

Write a program to calculate square root of a number using library function.

Answers

Answered by Secondman
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 phimtiyaj120
0

hazrul najanuddin aulia and Amir khusro (deccani school)

Similar questions