Doc attached 2

profilegental1983
it106_phase4_template.docx

Code Sample

Loop Type

Explanation

for (int i = 1 ; i <11 ; i++)

{

Console.WriteLine(“The counter is:” + i);

}

//program output

//The counter is: 1

//The counter is: 2

//The counter is: 3

//The counter is: 4

//The counter is: 5

//The counter is: 6

//The counter is: 7

//The counter is: 8

//The counter is: 9

//The counter is: 10

int i = 1;

while (i < 11)

{

Console.WriteLine(“The counter is: ” + i);

i++;

}

//program output

//The counter is: 1

//The counter is: 2

//The counter is: 3

//The counter is: 4

//The counter is: 5

//The counter is: 6

//The counter is: 7

//The counter is: 8

//The counter is: 9

//The counter is: 10

do

{

//statement(s)

}

while (condition);

for (int i = 1; i <= 10; i++) //outer loop

{

System.out.println(“The multiplication table for: ” + i);

for (j = 1; j <=10 ; j++) //inner loop loop

{

System.out.println(i + “ * ” + j + “ = ” + i*j);

}

}

/* program output

The multiplication table for: 1

1 * 1 = 1

1 * 2 = 2

1 * 3 = 3

...

...

..

1 * 10 = 10

The multiplication table for: 2

2 * 1 = 1

2 * 2 = 4

2 * 3 = 6

...

...

...

2 * 10 = 20

The multiplication table for: 3

.....

.....

The multiplication table for: 10

10 * 1 = 10

10 * 2 = 20

10 * 3 = 30

...

...

...

10 * 10 = 100

*/