• Ask a Question
  • Create a Poll
150
    Ask a Question
    Cancel
    150
    More answer You can create 5 answer(s).
      Ask a Poll
      Cancel
      Brong

      How to use square root in c programming?

      I was trying to use square root in c programming but I have failed. So I want to know How to use square root in c programming?
      Can anyone help me?

      2 Answers
      Brong

      The C library function double sqrt(double x) returns the square root of x.
      I give you a example below so can know how to use square root in c programing.
      The following example shows the usage of sqrt() function.

      #include <stdio.h>
      #include <math.h>
      
      int main ()
      {
      
         printf("Square root of %lf is %lf\n", 4.0, sqrt(4.0) );
         printf("Square root of %lf is %lf\n", 5.0, sqrt(5.0) );
         
         return(0);
      }
      Answered by jacob marten on August 23, 2016..
      Default

      In C programming language, the sqrt function returns the square root of x. The syntax for the sqrt function in C programming language is

      double sqrt(double x);

      Answered by ElysiumPro on December 29, 2019..