View on GitHub

marymafa.github.io


layout: post title: Research date: 2017-08-09 —

For loop

-Is a control statement for specifying iteration which allow code to be executed repeadly.

Important part for loop

1-loop initiation : where we initialize our counter to a string value.

2-Test staement : which will test if a given condition is true or false.

3-Interation statement : where you can increase or decrease your counter.

While loop

-Is a program you may encounter a situation where you need to perform an action over and over again.

-The purpose of while loop is to: 1-execute a statement or code block repeatedly as long as an expresion is true.

2-Is to terminate the loop once the expression become false.