This commit is contained in:
Akbar Rahman 2023-10-06 15:21:15 +01:00
parent 12c68a539b
commit 7681495eba
Signed by: alvierahman90
GPG Key ID: 20609519444A1269
2 changed files with 36 additions and 0 deletions

15
C11/ex2.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdio.h>
#define ARRAY_LEN 90
int main() {
int i;
float arr[ARRAY_LEN];
for (i = 0; i < ARRAY_LEN; i++) {
arr[i] = (float)i;
}
for (i = 0; i < ARRAY_LEN; i++) {
printf("%d %f\n", i, arr[i]);
}
}

21
C11/ex3.c Normal file
View File

@ -0,0 +1,21 @@
#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]);
}
}