For loop design ( Brief Lesson )
Author Message
For loop design ( Brief Lesson )

FOR LOOP design that resulted in this ****.  What I'm
confused about is the inner loop      ***  test
expression:                           **
--------------------                  *

for ( int i = 0; i < 4; i++ )
{
for ( int j = 0; j < 4 - 1; j++ )
cout << '*';
cout << endl;

Quote:
}

____________________

If 4 - 1 how is the first line going to be   **** ?
If you would please email me directly that would be nice,
if not it's ok, but I ask if I could email you back for
any further questions.   Thank you.

Sun, 23 Oct 2005 05:51:00 GMT
For loop design ( Brief Lesson )
I'm assuming that the inner loop should be
for ( int j = 0; j < 4 - i; j++ )
which means
4 - i and not 4 - 1

If you fix this then it is going to work as you expect.

Danut

Quote:
>     Today May 6, 2003  I asked a question about solving a
> FOR LOOP design that resulted in this ****.  What I'm
> confused about is the inner loop      ***  test
> expression:                           **
> --------------------                  *

> for ( int i = 0; i < 4; i++ )
> {
>     for ( int j = 0; j < 4 - 1; j++ )
>          cout << '*';
>              cout << endl;
> }
> ____________________

>      If 4 - 1 how is the first line going to be   **** ?
> If you would please email me directly that would be nice,
> if not it's ok, but I ask if I could email you back for
> any further questions.   Thank you.

Sun, 23 Oct 2005 06:32:33 GMT

 Page 1 of 1 [ 2 post ]

Relevant Pages