C Programming Code Examples C > Beginners Lab Assignments Code Examples C program to find square root of a number C program to find square root of a number Write a C program to input a number and find square root of the given number. How to find square root of a number in C programming using inbuilt sqrt() function. How to use predefined sqrt() function to find square root in C program. #include <stdio.h> #include <math.h> int main() { double j, root; /* Input a number from user */ printf("Enter any number to find square root: "); scanf("%lf", &j); /* Calculate square root of j */ root = sqrt(j); /* Print the resultant value */ printf("Square root of %.2lf = %.2lf", j, root); return 0; }