/*
  Program to compute a trigonometric table.
*/

#include <stdio.h>
#include <math.h>

main()
{
  /*  Declaration Statements  */
  double pi, radn, sine, cosine, angle;

  printf("C49.C -> Program to compute a trigonometric table \n");
  printf("\n");
  printf("%7s%7s%7s%7s\n", "angle", "radian", "sin", "cos");

  pi = 3.14159;

  /*  Assignment Statements  */
  angle = 0.0;                      /*  This program will produce */
  while (angle <= 45) {             /*  a trigonometric table for */
    radn = angle / 180.0 * pi;      /*  angles from 0.0 to 45.0   */
    sine = sin(radn);               /*  by step of 5 degrees.     */
    cosine = cos(radn);

    /*  Print results  */
    printf("%7.3f%7.3f%7.3f%7.3f\n", angle, radn, sine, cosine);
    angle += 5;
  }  /*  End of while{} loop  */
  printf("\f\n");

  return(0);
}
/*  End of Program C49 */