16-Write a C program to calculate the square root of a number.

Program: 16

Write a C program to calculate the square root of a number.

#include
#include
void main()
{
    int a;
    float s;
    printf("Enter the number: ");
    scanf("%d", &a);
    s=sqrt(a);
    printf("The square root of %d is: %f", a, s);
    getch();
}
Output
Enter the number: 53

The square root of 53 is: 7.280110

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.