Development C

#include
#include
#include
#include
/* 1 degrees = 0.0174532925 radians */
#define ONEDEGREE 0.0174532925
int main(int argc, char *argv[]) {
double base = 0;
double degrees = 0;
double radians = 0;
if(argc != 3)
error(1, 0, "base degrees");
else {
base = strtod(argv[1], (char **)NULL);
degrees = strtod(argv[2], (char **)NULL);
}
/* convert degrees to radians */
radians = degrees * ONEDEGREE;
printf("base : %.2f\n", base);
printf("degrees : %.2f\n", degrees);
printf("radians : %.2f\n", radians);
printf("tan : %.2f\n", tan(radians));
printf("height : %.2f * %.2f = %.2f\n", base, tan(radians), (base * tan(radians)));
return 0;
}