I am taking a programming class this semester and I am have trouble wit this homework. I think its called C so I hope this is the right place to post.
Here is the problem:
Problem: Given as integers (three in all) an angle in degrees, minutes, and seconds display the value converted
into radians.
Example Execution #1:
Enter number of degrees: 180
Enter number of minutes: 0
Enter number of seconds: 0
Data Entered: 180° 0' 0"
Radians Conversion: 3.1416
I have this program, but I can't compile it. What did I do wrong?
Code:
#include<stdio.h>
int main(void)
{
// Local Declarations
float d; // This will be the degrees of the angle
float m; // This will be the minutes of the angle
float s; // This will be the seconds of the angle
float angle; // This will be the final angle in radians
// Statements
printf("\nEnter the number of degrees:");
scanf("%f", &d);
printf("\nEnter the number of minutes:");
scanf("%f", &m);
printf("\nEnter the number of seconds:");
scanf("%f", &s);
// Converting to radians
angle =( 3.14159 / 180 ) * (d + (((m * 60) + 30) / 3600) )
// The angle in radians
printf("\nAngle in Radians: %5.5f\n\n", angle);
return (0);
}