SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
C program to find fibonacci series using while loop
C program to find fibonacci series using while loop
Input:
Enter the value of n to find fibonacci series upto n terms:
5
Output:
0 1 1 2 3
Implementation:
#include
int main(void) { int n; int i; int a=-1,b=1,c; printf("Enter the value of n to find fibonacci series upto n terms:\n"); scanf("%d",&n); i=1; while(i<=n) { c=a+b; printf("%d ",c); a=b; b=c; i++; } return 0; }
PREVIOUS
NEXT
HOME