Asked by
AL MaMun (4 Golds)
Friday, 31 Jul 2020, 04:16 PM
at (Education
Tutorials)
|
|
|
|
C program to find nth Fibonacci number #include<stdio.h> int main() { int a=0, b=1, c, i, n; printf("Want nth Fibonacci Number? "); scanf("%d", &n); for(i=2; i<n; i++) { c=a+b; a=b; b=c; } printf("nth Fibonacci Number = %d", b); return 0; } |