square root function in c

#include <stdio.h>
#include <math.h>

int main() {
    double num, result;

    // Step 1: Input a number from the user
    printf("Enter a number: ");
    scanf("%lf", &num);

    // Step 2: Calculate the square root using the sqrt() function from the math.h library
    result = sqrt(num);

    // Step 3: Display the result
    printf("Square root of %.2lf = %.2lf\n", num, result);

    return 0;
}