This blog is under construction

Sunday, 29 April 2012

tan example in C

Header file:
    math.h

Synopsis:
     double tan(double x);

Description:
     Returns tangent value of x.


tan function in C example:


  #include<stdio.h>
  #include<math.h>
  int main() {
        /*
         * degree to radian conversion
         * radian = degree * PI/180;
         */
  
      double deg, radian;
        printf("Enter your input:");
        scanf("%lf", &deg);
        deg = deg * (3.14 / 180);
        radian = tan(deg);
        printf("Result: %lf\n", radian);
        return 0;
  }



  Output:
  jp@jp-VirtualBox:~/cpgms/math$ gcc tan.c -lm
  jp@jp-VirtualBox:~/cpgms/math$ ./a.out
  Enter your input:45
  Result: 0.999204


1 comment:

  1. It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.

    Data Science Interview Questions

    Angular JS Interview Questions

    Big Data Training in Velachery

    AWS Certified Developer

    Best Resource of Learning Devops

    Blueprism Interview Questions

    Automation Anywhere Interview Questions

    ReplyDelete