Why do I get incorrect results from all the math library functions like cos() and tan()?

You must #include <math.h> before you call any of the standard
    Turbo C math functions. In general, Turbo C assumes that a function
    that is not declared returns an int. In the case of math functions,
    they usually return a double. For example

        /* WRONG */                       /* RIGHT */
                                          #include <math.h>
        main()                            main()
        {                                 {
          printf("%f", cos(0));             printf("%f", cos(0));

        }                                 }


Learn More :