Computer Science Of Engineering

Simple and practical computer science tutorials, programming guides, and engineering concepts for students and beginners.

Breaking

Friday, April 18, 2025

square root of a number in c

 



#include <stdio.h>

#include <math.h>


int main() {

    double number, result;

    printf("Enter a number: ");

    scanf("%lf", &number);


    result = sqrt(number);

    printf("Square root of %.2lf is %.2lf\n", number, result);


    return 0;

}



Output:





No comments:

Post a Comment