A few words of thanks would be greatly appreciated.

C Language - finding the square root of a number

Among the computer programming languages, C is the most basic and also the most widely used language. C can be used not only for text documents but can also be used for various mathematical operations. Statistical as well as mathematical exercises ranging from basic addition, subtraction, cube root, square root and many polynomial powers can be created through this general purpose programming language. To get the square root of any number, the C script can be customized to code the logic which leads to this.


A simple C program allowing you to find the square root of a number.

#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;     


  • In this code we make use of the sqrt function, more information available on :
  • Thanks to [TECH] from the forum for this tip.

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Published by . Latest update on by Rik Sharma.

This document, titled "C Language - finding the square root of a number," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).