# Section 7: Loops

## Loops - Iterative Statement

1. while
2. do while
3. Print the numbers example.
• while
• do while

## for loop

1. for
2. Print the numbers example
3. for each

## Infinite loop

1. You can skip condition in the for and define the initialization and condition somewhere else.

1. Example.

1. Example.

# Section 8: Array

## Introduction

1. Array can be any type, such as int, float, char.
2. Declaration:
3. You can initialize without assigning data, it will be 0. And you can initialize without length, it will give it a size automatically.

## Array Declarations

1. Declare the array without initialization.
2. If you assign more data than array length, it will have the compile error. For example, int A[5] = {2, 4, 6, 8, 10, 12};.
3. For each loop.
4. You can use auto to specify the type automatically.
5. If you don’t want to specify automatically, you can specify the type by yourself. For example, you can specify int to read char, it will show the ASCII code of char.

## For Each loop

1. You can use pointer to change the original value in the array by for each loop.

## Nested Loops

1. If you want to working on matrixes, it will use nested loops. For example.

## Multidimensional Array

1. Multidimensional array can initialize may ways. If you don’t specify the value, it will be zero.
2. print all value in the multidimensional array.
3. Use for each to print out the multidimensional array.