└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Fibonnic-series 2 | #include 3 | int main() { 4 | 5 | int i, n; 6 | 7 | // initialize first and second terms 8 | int t1 = 0, t2 = 1; 9 | 10 | // initialize the next term (3rd term) 11 | int nextTerm = t1 + t2; 12 | 13 | // get no. of terms from user 14 | printf("Enter the number of terms: "); 15 | scanf("%d", &n); 16 | 17 | // print the first two terms t1 and t2 18 | printf("Fibonacci Series: %d, %d, ", t1, t2); 19 | 20 | // print 3rd to nth terms 21 | for (i = 3; i <= n; ++i) { 22 | printf("%d, ", nextTerm); 23 | t1 = t2; 24 | t2 = nextTerm; 25 | nextTerm = t1 + t2; 26 | } 27 | 28 | return 0; 29 | } 30 | --------------------------------------------------------------------------------