Exercise Loop
1. Create a program to display all even number from A to B, in which A and B are the
inputs of this program.
Algoritma :
Step 1 start
Step 2 input a,b
Step 3 For i in range ( a, b+1) DO
If i % 2 == 0 THEN
Display i
Step 4 end
2. Create a program to display all numbers from A to B which divisible by C. A, B, and C are
the inputs of this program.
, Algoritma :
Step 1 start
Step 2 input a,b,c
Step 3 for i in range ( a, b) DO
if i % c == 0 THEN
Display i
Step 4 END
3. Create a program to find and display all factors of a number.
1. Create a program to display all even number from A to B, in which A and B are the
inputs of this program.
Algoritma :
Step 1 start
Step 2 input a,b
Step 3 For i in range ( a, b+1) DO
If i % 2 == 0 THEN
Display i
Step 4 end
2. Create a program to display all numbers from A to B which divisible by C. A, B, and C are
the inputs of this program.
, Algoritma :
Step 1 start
Step 2 input a,b,c
Step 3 for i in range ( a, b) DO
if i % c == 0 THEN
Display i
Step 4 END
3. Create a program to find and display all factors of a number.