Vina Mulyani
Algoritma
- untuk yg for
for i = 1 to 100 do
if (i mod 2 = 1) then
output(i)
- untuk yg while
int i
i=1
if (i mod 2 = 1) then
output(i)
Bahasa program C
- untuk yg for
int i;
if (i % 2 == 1) {
- untuk yg while
int i;
i = 1;
if (i % 2 == 1) {
i++;
Program Pascal
- untuk yg for
for i = 1 to 100 do
if (i mod 2 = 1) then
output(i);
end;
readln;
end;
- untuk yg while
int i;
i = 1;
if (i mod 2 = 1) do
output(i);
end;
readln;
end;