luc008.c (921B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* If value of an angle is input through the keyboard, 8 write a program to print all its trigonometric ratios. */ 9 /* Let Us C, Chap - 2, Page - 37, Qn No.: G(e) */ 10 11 #include <stdio.h> 12 #include <math.h> 13 int main() 14 { 15 double inp, rsin, rcos, rtan, rcosec, rsec, rcot; 16 printf("Enter the Angle in degree : "); 17 scanf("%lf", &inp); 18 inp = inp * (M_PI / 180); //changing degree to radian 19 rsin = sin(inp); 20 rcos = cos(inp); 21 rtan = tan(inp); 22 rcosec = 1 / rsin; 23 rsec = 1 / rcos; 24 rcot = 1 / rtan; 25 printf("\nTrigonometric ratios :-" 26 "\nsin = %g " 27 "\ncos = %g" 28 "\ntan = %g" 29 "\ncosec = %g" 30 "\nsec = %g" 31 "\ncot = %g", 32 rsin, rcos, rtan, rcosec, rsec, rcot); 33 return 0; 34 }