C Program to find the Square Root of a number
This is the C program to find the square root of a number using predefined function,use -lm (linking math) for compiling
eg: cc prog.c -lm
#include<stdio.h>
#include<math.h>
main()
{
double x;
double y;
printf("Enter the number for which you want to find the square root n");
scanf("%lf",&x);
y=sqrt(x);
printf("The square root is %lf n",y);
}
Recent Comments