Skip to content

Commit

Permalink
Create fibonacci_triangle.c
Browse files Browse the repository at this point in the history
  • Loading branch information
rajpootrahul6113 authored Oct 5, 2019
1 parent d987885 commit d168ae9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions fibonacci_triangle.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include<stdio.h>
#include<stdlib.h>
int main(){
int a=0,b=1,i,c,n,j;
system("cls");
printf("Enter the limit:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
a=0;
b=1;
printf("%d\t",b);
for(j=1;j<i;j++)
{
c=a+b;
printf("%d\t",c);
a=b;
b=c;

}
printf("\n");
}
return 0;
}

0 comments on commit d168ae9

Please sign in to comment.