Hey. I'm trying to do a program for school, and I'm haveing for loop problems. I'm trying to make a triangle that looks like this...
AC
A C
A C
A C
ABBB
something like that. Anyway, I basically need to add another space between the A and C in each new row. I was thinking if I did something like
(for int j=0, j
{
cout << var1 NUMSPACES var3 << endl;
}
Is there a way I can make a variable represent spaces? Like, NUMSPACES = 0, and have the code know that 0 is the number of spaces? so when I change it to NUMSPACE = 2, it knows that I want two spaces?
2006-12-09
02:37:18
·
2 answers
·
asked by
Finn
1