Nama : Riki Candra Kelas : 1 Ka 20 Npm : 1 1 1 0 8 6 7 8 Dosen : Pak Achsan. 1. program no_1;{Repeat-Until} uses crt; var i,j :integer; begin clrscr; write('masukan angka looping : ');readln(i); j :=0; repeat j :=j+1; writeln(j); until j=i; readln; end. program no_1;{while} uses crt; var i,j :integer; begin clrscr; write('isi kan angka looping : ');readln(i); j:=1; while j<=i do begin writeln(j); j:=j+1; end; readln; end. program no_1;{For} uses crt; var i,k: integer; begin clrscr; write('masukan nilai : ');readln(i); for k:= 1 to i do writeln(k); readln; end. 2. program no_2;{REPEAT-UNTIL} uses crt; var i,j :integer; begin clrscr; write('masukan angka looping : ');readln(i); j :=i+1; repeat j :=j-1; writeln(j);
"TUGAS
PASCAL"
until j=1; readln; end. program no_2;{while} uses crt; var i,j :byte; begin clrscr; write('isi kan angka looping : ');readln(i); j:=i; i:=i+1; while j
j:= 0+1; writeln(l+j+i); end; end; readln; end. program no_3; uses crt; var awal,akhir,i:integer; begin clrscr; awal :=1 ; akhir:=15; i:=awal-2; repeat i:=i+2; writeln(i); until i = akhir; readln; end. 4. program no_4; uses crt; var awal,akhir,i :integer; begin clrscr; awal := 1; akhir:=15; i:= akhir+2; repeat i:=i-2; writeln(i); until i=awal; readln; end. program no_4; uses crt; var awal,akhir,i :integer; begin clrscr; awal := 1; akhir:=15; i:= akhir+2; repeat i:=i-2; writeln(i); until i=awal; readln; end. program no_4; uses crt; var awal,akhir,i :integer; begin
clrscr; awal := 1; akhir:=15; i:= akhir+2; repeat i:=i-2; writeln(i); until i=awal; readln; end. 5. program no_5; uses crt; var a,i,awal,akhir,jumlah : word; begin clrscr; write('masukan nilai awal : ');readln(awal); write('masukan nilai akhir: ');readln(akhir); jumlah:=0; for i:= awal to akhir do begin write('masukan nilai ke ',i, '=');readln(a); jumlah:=jumlah + a ; end; writeln('jumlah bilangan - bilangan tersebut adalah : ',jumlah); readln; end.