Ask a question »

# How to find square root in C program?

January 2015

Among various computer programming languages, C is the most basic and widely used language. It gives maximum efficiency and control to the programmers. The C language can be used for mathematical operations ranging from additions and subtractions to square roots and cube roots, alogn with other polynomial powers that can be created through C programming. If you want to write mathematical programs which involve floating points and so on then you will need access to the mathematics library. To find the square root of a number, you can customize the C script to code the logic by using the sqrt function.

Here is sample program:

Thanks to TECH for this tip on the forum.

For unlimited offline reading, you can download this article for free in PDF format:

# How to find square root in C program?

## Issue

**How to find square root in C program?**## Solution

Here is sample program:

#include <math.h> #include <stdio.h> int main(void) { double x = 4.0, result; result = sqrt(x); printf("The square root of %lf is %lfn", x, result); return 0; }

**Visit:**http://hubpages.com/_eknow/hub/Turn-Your-PC-Keyboard-to-Musical-Keyboard for a great C program.## Note

Thanks to TECH for this tip on the forum.

For unlimited offline reading, you can download this article for free in PDF format:

How-to-find-square-root-in-c-program.pdf

## See also

- How to program root in c language
- Square root in c
- Square root logic in c
- C Language - finding the square root of a number » How-To - C Language
- C++ program computing sum of squares of two » Forum - Programming
- C programming software » Download
- Cannot open google chrome (Solved) » Forum - Google Chrome
- Compiling a C program under linux » How-To - Programming