Pages

Tugas Mandiri Struktur Data

If_Else

var
a:integer;
begin
writeln('-----------------------------------');
writeln('     DAFTAR NILAI STRUKTUR DATA    ');
writeln('-----------------------------------');
write('Masukkan nilai anda: ');
readln(a);
if (a>=80) and (a<=100) then
writeln('Anda Pinter')
else
if (a>=60) and (a<=79) then
writeln('Rodo Pinter')
else
if (a>=0) and (a<=59) then
writeln('Kebangetan!!!')
else
writeln('Masukkan nilai dari 0 - 100 ');
readln;
end.
 


Case_Of


var
a:integer;
begin
writeln('------------------------------');
writeln(' DAFTAER NILAI STRUKTUR DATA  ');
writeln('------------------------------');
write('Masukkan nilai anda : ');
readln(a);
case a of
80..100:writeln('Pinter');
60..79:writeln('Rodo Pinter');
0..59:writeln('Kebangetan!!!');
end;
readln;
end.


For_To_Do

var
a:integer;
begin
for a:=25 to 30 do
writeln(a);
readln;
end.

Repeat_Until

var
a:integer;
begin
a:=25;
repeat
writeln(a);
a:=a+1;
until a=31;
readln;
end.


While_Do

var
a:integer;
begin
a:=24;
while (a<30) do
begin
a:=a+1;
writeln(a);
end;
readln;
end.




0 komentar:

Posting Komentar