Skip to content

Commit

Permalink
Create Fibonacci series
Browse files Browse the repository at this point in the history
  • Loading branch information
Divyangana-12 authored Oct 8, 2020
1 parent 208aa91 commit fc54230
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Fibonacci series
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>

int main(void)
{
int n, i,a,b,c;
printf("\n enter the number of terms");
scanf("%d", &n);
a=0, b=1;
printf("\n the fibonacci series: ");
printf("\t %d \t %d", a,b);
for(i=2; i<n; i++)
{
c=a+b;
printf("\t%d", c);
a=b;
b=c;
}
}

0 comments on commit fc54230

Please sign in to comment.