What I am trying to do is print four triangles of asterisks, going in this order:
*
**
***
***
**
*
***
_**
__*
__*
_**
***
(EDIT: The spaces were being taken out when I posted it, so I added underscores so the placement of asterisks would be correct. I need the print to be spaces instead of underscores.)
This set up, except going up to ten asterisks. I also put spaces between the triangles here just so it can be seen clearer. What I have so far:
#include <stdio.h>
int main (void)
{
int i,j;
i=1;
for (i=1; i <= 10; i++) {
for( j=1; j<i+1; j++) {
printf("*");
}
printf("\n");
}
{
int t,f;
t=1;
for (t=1; t<=10; t++) {
for (f=10; f>t-1; f--) {
printf("*");
}
printf("\n");
}
{
int u,h;
u=1;
for(u=1; t<=10
return 0;
}
}
Any help on how to get the spaces to show up before the asterisks in the second two triangle patterns would be greatly appreciated. Once again, I'm still fairly new and have a hard time understanding the logic of the code, but I am starting to grasp it slightly.
This post has been edited by Archael: 21 September 2011 - 09:46 AM

New Topic/Question
Reply



MultiQuote




|