sqrt

Overview :

The "sqrt" function is used for calcution of the positive square root of a number.

Syntax :
double sqrt(double x);
Description :

The "sqrt" function accepts 1 parameters

  • x -> The x is the number whose square root is to be found

  • If x is positive then the result will be positive

  • If x is negative then the fucnction sets an error

"sqrt" function return the square root of a number.

Example :
#include <stdio.h>
 #include <math.h>
 #include<conio.h>

 int main()
 {
    double x,square_root;
	clrscr();
	printf("\nEnter the number : ");
	scanf("%lf",&x);

    square_root = sqrt(x);
    printf("The square root is %lf\n", square_root);
    getch();
    return 0;
}

Comments

comments powered by Disqus