Minggu, 05 Desember 2010

coding segitiga

#include<stdio.h>
#include<conio.h>
void main()
{
int nilai,i,k,j;
printf("Massukan Bil : ");
scanf_s("%d", &nilai);
for ( i=1; i<=nilai; i++){
for ( k=i; k<((3*nilai)-(2*1)); k++)
printf(" ");
for ( j=0; j<i; j++){
if (j==1-1 || j==1*i-1)
printf("1 ");
else
printf("%d ",nilai);
}
printf("\n");
}
getch();
}
indahnya berbagi...

0 comments:

Posting Komentar