C programming
#include <math.h>
int main()
{
double num, squareRoot;
printf("Enter a number : ");
scanf("%lf", &num);
squareRoot = sqrt(num);
printf("Square root of %0.2lf = %0.4lf", num, squareRoot);
return 0;
}
Try it Yourself ➠
Squareroot of a number in C
26 July
0
Write a program (WAP) in C to calculate Square root of a number.
#include <stdio.h>#include <math.h>
int main()
{
double num, squareRoot;
printf("Enter a number : ");
scanf("%lf", &num);
squareRoot = sqrt(num);
printf("Square root of %0.2lf = %0.4lf", num, squareRoot);
return 0;
}
Must Read :-
Previous article
Next article
Leave Comments
Post a Comment