Bahasa Algoritma:
Var
X:Integer
Y:Integer
Z:integer
Begin
OUTPUT('Masukan Nilai Awal: ') INPUT(x)
OUTPUT('Masukan Nilai Akhir: ') INPUT(Y)
Repeat
Begin
if z mod 3 <> 0 then
Output()
Else
Output(z,' ')
Z-->x
X-->x+1
END REPEAT
Until x > Y+1
END Algoritma
Bahasa Pascal:
Uses crt;
Var
X:Integer;
Y:Integer;
Z:integer;
Begin
CLRSCR;
WRITELN('Masukan Nilai Awal: '); READLN(x);
WRITELN('Masukan Nilai Akhir: '); READLN(Y);
Repeat
Begin
if z mod 3 <> 0 then
WRITE()
Else
WRITE(z,' ');
Z:=x;
X:=x+1;
END;
Until x > Y+1;
READLN();
END.
Var
X:Integer
Y:Integer
Z:integer
Begin
OUTPUT('Masukan Nilai Awal: ') INPUT(x)
OUTPUT('Masukan Nilai Akhir: ') INPUT(Y)
Repeat
Begin
if z mod 3 <> 0 then
Output()
Else
Output(z,' ')
Z-->x
X-->x+1
END REPEAT
Until x > Y+1
END Algoritma
Bahasa Pascal:
Uses crt;
Var
X:Integer;
Y:Integer;
Z:integer;
Begin
CLRSCR;
WRITELN('Masukan Nilai Awal: '); READLN(x);
WRITELN('Masukan Nilai Akhir: '); READLN(Y);
Repeat
Begin
if z mod 3 <> 0 then
WRITE()
Else
WRITE(z,' ');
Z:=x;
X:=x+1;
END;
Until x > Y+1;
READLN();
END.
Tidak ada komentar:
Posting Komentar