Finding square root of any number is pretty simple. In this post, i will explain you step-by-step to find square root of any given number using a predefined function sqrt(). Before checking program, i will suggest you to clear your concept related to "What is square root & how to find them ?"
For better understanding of C program, please refer C program of addition of two numbers.
Square root of any number is just the reverse of squaring of that number. We already know that square of any number is the number multiplied by itself. i.e., if we suppose to find the square of any number say 3, then its square is 9.
Coming to square root,
Square root of any number (say) 81 is 9. Lets find it graphically.
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int n,result;
printf("Enter any number :\t");
result=sqrt(n);
printf("\nSquare root of given number is : %d",result);
getch();
}