This is C program that asks user to find out the square root of a number. for this operation user declare a variable for fetching the output on it user also declare a math.h header file this file contains all the math functions for required operation. Then user asks a number to find out the square root put on the square root function the last move to fetches out the result as output on the screen.
Problem Statement:
This is a C program to find out the square root of a number.
- Declare variables.
- Using math function.
- Display result on the screen.
Here is C source code for finding out the square root. Output of this program shown below.
#include <stdio.h>
#include <math.h> /* needed by sqrt() */
int main(void)
{
double answer;
clrscr();
answer = sqrt(20.0);
printf("Square Root of a Give Value : %f", answer);
getch();
return 0;
}