KRHS Internet Lesson

Teacher Name:Mr. Rung                          Date of Lesson: December

Course Name: C++                    Lesson Name: Chap 8.1b

Student Name

Password


Objective
To complete the workbook exercises.


Primary Focus
Please answer the questions below.

Site Links
Course Home Page

Additional Resources

Site Links


Question #1

How many times will the following for loop repeat?

for (i = 1; i < = 5, i++)


Question #2

How many times will the following for loop repeat?

for (i = 2; i < = 5; i++)


Question #3

How many times will the following for loop repeat?

for (i = 2; i <  5; i++)


Question #4

What is the count progression of the variable I in the following for statement?

for (i = 3; i < 12 ; i = i + 2)


Question #5

What is the value of j in each iteration of the following loop?

int i,j;

for (i = 10; i <= lOO; i = i + 10)

j = i / 2;


Question #6

How many times will a loop controlled by the following statement iterate?

for (j = 5; j<=20; j = j + 5)


Question #7

What is the value of r after the following statements have executed?

int r,j;

for (j = 1; j < 10; j =j*2);
r = 2*j;


Question #8

Write a loop that will print the numerals 3, 6, 12,24,48, and 96.


Question #9

Write a loop that will print the numerals 96,48, 24, 12, 6, and 3.


Question #10

Write a ioop that will print the numerals 256,128, 64, 32, 16, 8, 4, 2 and 1.