Write a program to print the Fibonacci series
0. 1. 1. 2. 3. 5, ... n.
Answers
Answered by
2
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;
}
BRO PLEASE FOLL!OW ME I'LL GIVE YOU ANSWERS IN ALL I.T RELATED QUESTIONS
Similar questions