C Program To Find Square root of a Number

CODE FOR FINDING SQAURE ROOT.

  #include<stdio.h>
  
   #include<math.h>

   int main()

 {
   int x;
   
   printf("Enter the number to get its square root");

   scanf("%d",&x);

   float sqrroot;

   sqrroot = sqrt(x);

  printf("The square root of %f = %f ",x,sqrroot);
  
  return 0;

  }

You can use getch(); instead of return 0; 

OUTPUT - Enter the number to get its square root  144

square root of 144 = 12

No comments:

Post a Comment