[My site ]
Main » 2013 » December » 13 » midterm 2008-2009 Q2
0:21 AM
midterm 2008-2009 Q2
 1+1=2
   1+2=3
     2+3=5
       3+5=8
         5+8=13


#include"stdio.h"
main()
{
int x=1, y=1, z, n, i, j;
printf("enter number of raws : ");
scanf("%d", &n);
for(i=1;i<=n;i++){
for(j=1;j<=2*i-1;j++)
printf(" ");
z=x+y;
printf("%d+%d=%d\n", x, y, z);
x=y;
y=z;
}
getch();
return 0;
}
Category: C Programming - 1 | Views: 483 | Added by: ahansaary | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Sign Up | Login ]