This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/Exercises/C10/ex2.c

20 lines
299 B
C
Raw Normal View History

2023-10-06 12:58:30 +00:00
#include <stdio.h>
#include <math.h>
float degrees_to_radians(float degrees) {
return M_PI * degrees / 180.0;
}
int main() {
float input, output;
printf("Enter an angle in degrees: ");
scanf("%f", &input);
output = degrees_to_radians(input);
printf("%f radians\n", output);
return 0;
}