Computer Science, asked by daksh100lanki122, 8 months ago

write a program for displaying Fibonacci series for 20 terms​

Answers

Answered by preeti5365
4

Answer:

#include <stdio.h>

int main() {

int i, n, t1 = 0, t2 = 1, nextTerm;

printf("Enter the number of terms: ");

scanf("%d", &n);

printf("Fibonacci Series: ");

for (i = 1; i <= n; ++i) {

printf("%d, ", t1);

nextTerm = t1 + t2;

t1 = t2;

t2 = nextTerm;

}

return 0;

}

Explanation:

mark me brainliest

Similar questions