KRHS Internet Lesson

Teacher Name:Mr Rung                          Date of Lesson: December

Course Name: C++                    Lesson Name: Chap 8.2c

Student Name

Password


Objective
To complete the workbook exercises.


Primary Focus
Please answer the questions below.

Site Links

Additional Resources

Site Links


Question #1

After the following programs have run, what will the output to the screen look like? Write your answer in the space provided.

include &ltiostream.h>


main()
{
int i=0, j=0;
while (i <= 3)
{
for(j=0; j<=2;j++)
cout « i « j « endl;
}
return 0;
}


Question #2

After the following programs have run, what will the output to the screen look like? Write your answer in the space provided.

#include &ltiostream.h>


main()
{
int i=0, j=0;
for (i=0; i&lt3; i++)
{
for(j=3;j&gt0;j — —)
{
if(i==O)
cout « j « endl;
else
cout « i « j « endl;
}
}
cout « ”End of Loops\n”;
return 0;
}