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

    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;

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  
 
 [ 2 post ] 

 Relevant Pages 

1. exchanging lessons of italian vs lessons of english

2. For loop design part two

3. For loop Design

4. New C# Tutorial Lesson @ C# Station

5. BRIEF keyboard compatibility

6. Book review (brief)

7. C-Lesson.zip

8. A brief C question.

9. Lessons in Programming

10. Missing lessons link

11. c-lesson.zip

12. Lessons

 

 
Powered by phpBB® Forum Software