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/C11/ex3.c

22 lines
334 B
C
Raw Permalink Normal View History

2023-10-06 14:21:15 +00:00
#include <stdio.h>
#include <math.h>
#define ARRAY_LEN 90
float degrees_to_radians(float degrees) {
return M_PI * degrees / 180.0;
}
int main() {
int i;
float arr[ARRAY_LEN];
for (i = 0; i < ARRAY_LEN; i++) {
arr[i] = degrees_to_radians((float)i);
}
for (i = 0; i < ARRAY_LEN; i++) {
printf("%d %f\n", i, arr[i]);
}
}