Lesson 3: Loops This is the third installment of the Lessons in C programming tutorials created by me, Alexander. In this lesson I will cover loops. Loops basically do what it sounds like, loop. If you have read lesson 2 you should understand some Boolean expressions. If you do not, you should read it again. When working with loops it is important to understand truth and false. Maybe you should try doing some truth tables with problems. There are basically 3 types of loops. FOR, WHILE, DO WHILE Each of them has their uses. They are all outlined below. FOR - FOR loops are the most useful type, I believe. The layout is for(variable initialization, conditional, incrementing variable) It is very versatile, and the layout can be changed somewhat. Basically, the variable initialization allows you to either declare a variable and give it a value, or give a value to another variable. Second, the conditional statement. What it does is it says that while the conditional is true then it would do what in is in the body. Third, the incrementing variable section. It does not have to increment a variable. It can decrement, which is subtracting one, or it can perform various other manipulations on the variable. Ex. #include //We only need one header file void main() //We always need this { //The loop goes while x<100, and x has one for(int x=0;x<100;x++)/*THE LOOP*/ //added to it every time the loops { cout< //We only need this header file void main() //Of course... { int x=0; //Don't forget to declare variables while(x<100) //While x is less than 100 do { cout<