Q: If value of an angle is input through the keyboard, write a program to print all its Trigonometric ratios.

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

int main()
{
    float degree, radian;
    float PI = 3.14159;

    printf("Enter angle in degree\n");
    scanf("%f",&degree);

    radian = degree * (PI / 180.0);

    printf("Sin(%f) = %f\n", degree, sin(radian));
    printf("Cos(%f) = %f\n", degree, cos(radian));
    printf("Tan(%f) = %f\n", degree, tan(radian));
    printf("Cosec(%f) = %f\n", degree, 1/sin(radian));
    printf("Sec(%f) = %f\n", degree, 1/cos(radian));
    printf("Cot(%f) = %f\n", degree, 1/tan(radian));

    return 0;
}

-----------------------------------------
output :
Enter angle in degree
30
Sin(30.000000) = 0.500000
Cos(30.000000) = 0.866026
Tan(30.000000) = 0.577350
Cosec(30.000000) = 2.000001
Sec(30.000000) = 1.154700
Cot(30.000000) = 1.732052

Comments

Popular posts from this blog

Q: Two number are input through the keyboard into two two locations C and D. write a program to interchange the contents of C and D.

Q: Consider a currency system in which there are note of seven denominations, namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100. if a sum of Rs. N is entered through the keyboard, write a program to compute the smallest number of notes that will combine to give Rs N.