C library function atan()




C library function atan()

#include <stdio.h>
#include <math.h>
#define PI 3.141592654

int main()
{
    double num = 1.0;
    double result;

    result = atan(num);

    printf("Inverse of tan(%.2f) = %.2f in radians", num, result);

    // Converting radians to degrees
    result = (result * 180) / PI;
    printf("\nInverse of tan(%.2f) = %.2f in degrees", num, result);

    return 0;
}

Output

Inverse of cos(1.00) = 0.79 in radians
Inverse of cos(1.00) = 45 in degrees