C Programming Example For Fibonacci Series
This Article From Learn c programming in Hindi Will help you to learn Fibonacci Series With C programming language Example and check out
"selection sort program in c", "socket programming in c", "merge sort
program in c","Kruskal's algorithm in c", "for loop c programming", "c
struct example","simple program in c language", "simple CPP program", "c
programming practice questions", "c program using for loop",
"programming using c", "hello world program in c", "if statement in c ".
![]() |
C program Example |
Learn About Fibonacci Series with C Program Example
पहली श्रृंखला के दो नंबर 0 और 1. 3 नंबर से हैं। श्रृंखला में पिछली 2 संख्याओं का योग होगा।
फाइबोनैचि श्रृंखला: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, आदि।
C Program Example Source Code
#includeint main() { int f1=0, f2=1, fib_ser, cnt=2, lmt; printf("Please enter the limit of the Fibonacci series :"); scanf("%d",&lmt); printf("\nFibonacci series is: \n%d \n%d \n",f1,f2); while (cnt < lmt) { fib_ser=f1+f2; cnt++; printf("%d\n",fib_ser); f1=f2; f2=fib_ser; } return 0; }
OUTPUT
Please enter the limit of the Fibonacci series : 10 Fibonacci series is: 0 1 1 2 3 5 8 13 21 34
0 Comments:
Post a Comment