Algorithm and Programming (Repetition)
Algorithm & Programming (Repetition)
Repetion is instructions that is repeated in a certain amount of time
Repetion :
1. For
2. While
3. Do while
1. FOR
for (exp1, exp2, exp3){
statements;
}
exp1 : initialization
exp2 : condition
exp3 : increment or decrement
2. WHILE
Statement will never be executed if the expression false
while (exp) statements;
3. DO WHILE
Expression done after executing the statements.
Statement will be executed minimum once.
do {
statements;
}while(exp);
References:
Paul Deitel
& Harvey Deitel. (2016). C how to program : with
an introduction to C++. 08. Pearson
Education. Hoboken. ISBN: 9780133976892. Chapter
3 & 4
Doing
the Same Thing Over and Over: http://aelinik.free.fr/c/ch07.htm
Name=Samuel Xavier Wdjaja
binus.ac.id
skyconnectiva
Comments
Post a Comment