1: #include<stdio.h>
2: int main()
3: {
4: int n, first = 0, second = 1, next, c;
5: printf("Enter the number of terms\n");
6: scanf("%d",&n);
7: printf("First %d terms of Fibonacci series are :-\n",n);
8: for ( c = 0 ; c < n ; c++ )
9: {
10: if ( c <= 1 )
11: next = c;
12: else
13: {
14: next = first + second;
15: first = second;
16: second = next;
17: }
18: printf("%d\n",next);
19: }
20: return 0
getsprogramming Tutorials , C Programming, CPP Programming and JAVA Programming , Python Programming , Javascript Programming Welcome to getsprogramming Blog Here You Find Different Programs in Easier way to Explain and gain Knowledge and Try Your Self..Thanks
Monday, 13 July 2015
Write a C Program To Print Fibbonacci Series
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment