/* Fibonacci Triangle. */
#include <stdio.h>
int main()
{
int n, i, j, k, l, a, b, c;
printf("Enter number of terms: ");
scanf("%d", &n);
for(i = 1; i <= n; i++){
a = 0;
b = 1;
for(k = 1; k <= i; k++){
c = a + b;
b = a;
a = c;
printf("%d\t", b);
}
printf("\n");
}
return 0;
}
Comments
Post a Comment