#include <stdio.h>
#include <conio.h>
main()
{
int a,b,c,d,e,f;
printf("masukan tinggi segitiga = ");
scanf("%d",&a);
printf("1\n");
for (c=2;c<=a;c++)
{ b=c;
printf("%d ",c);
for (d=1;d<=c;d++)
{if(d==1||d==2)
{
b=b+a-1;
}
else b=b+a+1-d;
printf("%d ",b);
}
printf ("\n");
}
getch();
}
Friday, 26 October 2018
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment