bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

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 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror