c-compiler/test.c
2026-04-15 20:01:20 +03:00

32 lines
533 B
C

void printf(char*, ...);
int fibonacci(int n) {
if (n < 2)
return 1;
return fibonacci(n - 1) + fibonacci(n - 2);
}
void change_first(char otus[5]) {
otus[0] = 115;
}
struct Otus {
int field
};
int main() {
char text[29] = "10th fibonacci number is %d!";
printf(text, fibonacci(10));
char somelist[5] = { 1, 2, 3, 4, 5 };
change_first(somelist);
printf(" first element: %d!", somelist[0]);
struct Otus otus = { 5 };
printf(" first field: %d!", otus.field);
return 0;
}