Wyo C++
Ch. 8 Worksheet #6
   Name -

Do the following exercises on lined paper. Do not use a C++ compiler. Neatly show the displayed output in a diagram as well as the intermediate values (a running list of values in column form) of all variables cited in the code segments below. You may use dots (i.e. ellipsis) to show a pattern but be sure to show all final values.

1.

int i = 0;
int k = 0;

for ( i = 19; i > 6; i -= 5)
{
     cout << i << endl;

     for (k = 3; k > 0; k--)
     {
          cout << (i + k) << endl;
     }

}

2.
int number = 0;
int i = 0;

while (number < 8)
{
     number++;

     for (i = 1; i < 10; i++)
     {

           if ( i % 6 = = 0)
           {
                break;
            }
            else
            {
                 cout << i << endl;
            }

      }

}