#include #include int main() { int a[40]; int i, n; double ratio[40]; printf("Enter number of terms (<= 40): "); scanf("%d", &n); a[0] = 1; a[1] = 1; ratio[0] = 1; ratio[1] = 1; for (i = 2; i < n; i++) { a[i] = a[i - 1] + a[i - 2]; ratio[i] = a[i] / a[i - 1]; } for (i = 0; i < n; i++) printf("%d ", a[i]); printf("\n"); for (i = 0; i < n; i++) printf("%lf ", ratio[i]); printf("\n"); }