Just another WordPress.com site

Tugas SOD 2


Coding Program memakai Turbo Pascal
(jangan lupa pake ; ya)

uses crt;
label1;
var q: integer;
i :integer;
jawab:char;
a,b,c,d:string;
begin
repeat
clrscr;
writeln(‘——-menu——-‘);
writeln(‘1.concat :’);
writeln(‘2.insert :’);
writeln(‘3.length :’);
writeln(‘==============’);
writeln(‘masukan pilihan anda=’);
readln(q)
case q of
1:
begin
write(‘kata1 :’); readln (a);
write(‘kata2 :’); readln (b);
write(‘kata3 :’); readln (c);
d:=concat(a,b,c);
writeln(d);
end;
2:
begin
write(‘kata1 :’); readln (a);
write(‘kata2 :’); readln (b);
write(‘kata3 :’); readln (c);
d:=concat(a,b,c);
insert(‘&’,d,7);
writeln(d);readln(d);
end;
3:
begin
write(‘kata1 :’); readln (a);
write(‘kata2 :’); readln (b);
write(‘kata3 :’); readln (c);
d:=concat(a,b,c);
I:=length(d);
writeln(‘panjang string d:’,I); readln;
end;
end;
write(‘apakah anda ingin mengulanginya? (y/t):’);
readln(jawab);
until(jawab=’t’);
end.

outputnya adalah
———-menu———-
1.concat :
2.insert :
3.lenth :
==================
masukan pilihan anda =
1
kata1 : Nurul
kata2 : Hilaliyah
kata3 : 2ka16
Nurul Hilaliyah 2ka16
apakah anda ingin mengulanginya?
y
masukan pilihan anda =
2
kata1 : Nurul
kata2 : Hilaliyah
kata3 :Yuy
Nurulhilal&iyahyuy
apakah anda ingin mengulanginya?
y
masukan pilihan anda =
3
kata1 : struktur
kata2 : organisasi
kata3 : data2
panjang string d:23

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

Awan Tag

%d blogger menyukai ini: