Algorithm Part 9 Program Control Repetiton
Algorithm Part 9 Program Control Repetition Repetition means One or more instructions that runs in one time. Repetition can be divided 3 types: 1. For 2. While 3. Do-While 1.For For statement can be used if the user initalized first the variable, and then the condition and last is condition after the looping done,seperated by semi-colon (;) the format is like this: for(exp1;exp2;exp3){ [statements] } Example: for(int i=0;i<5;i++){ [statements] } means of int i=0 is the initialization that i have the value of 0 after that i<5 means while i<5 it will looping until condition is meet (until n>=5) and the last is condition of the end looping its mean i++ thats mean i+1 everytime it looping so the program will looping 5 times. 2.While While condition can be used instantly the condition,do-while is slig...