for(int i=0;i<10;printf("\n",i++))
for(int j=0;j<=10+i;printf("%c",(j++ < 10-i)?' ':'*'));
// another method to get
BOOL var = TRUE;
int n = 3;
for(int i=0;i
{
var = TRUE;
for(int j=0;j<= n+i;j++)
{
if (j >= n-i)
{
if (var == TRUE) {
printf("*");
var = FALSE;
} else {
var = TRUE;
printf(" ");
}
} else {
printf(" ");
}
}
}
No comments:
Post a Comment