Jul 30, 2024
for i := 1 to m do
with possible step
increments.for(i = 0; i < n; i++) {
// some statements
}
while(condition) {
// some statements
}
int i = 0;
while(i < n) {
i++;
}
do {
// some statements
} while(condition);
int i = 0;
do {
i++;
} while(i < n);
repeat
// some statements
until condition;
int a = 1;
while(a < b) {
a *= 2;
}
a >= b
.for(a = 1; a < b; a *= 2) {
// some statements
}
int i = n;
while(i > 1) {
i /= 2;
}
i <= 1
.for(i = n; i > 1; i /= 2) {
// some statements
}
int k = 1, i = 1;
while(k < n) {
k += i;
i++;
}
for(k = 1, i = 1; k < n; i++) {
k += i;
}
if(n < 5) {
// some statements
} else {
for(int i = 0; i < n; i++) {
// some statements
}
}