-->

Sunday, 22 February 2015

Cara membuat program pascal input di free pascal



Oke kali ini saya akan menjelaskan bagaimana cara membuat program input yang sederhana pada free pascal

1.Pertama buka program free pascalnya
2.Setelah itu buat baru file > new
3. ketikan / copas kode dibawah





 Versi 1
program input;
uses crt;
var
b,c,d,e, f:string;
begin
clrscr;
writeln('=================================');
writeln('            Data Siswa             ');
writeln('=================================');
write('Nama                       :');readln(b);
write('Umur                       :');readln(c);
write('No Absen               :');readln(d);
write('Kelas                        :');readln(e);
writeln('=================================');
writeln('=================================');
writeln('            Data Siswa             ');
writeln('=================================');
writeln('Nama Saya  ',b);
writeln('Umur Saya  ',c);
writeln('Nomer Absen Saya  ',d);
writeln('Saya Kelas ',e);
writeln('=================================',f);
readln;
end.

 Versi 2


Program input1;
uses crt;
var          nama,sekolah,agama,jurusan:string;
                kelamin,kelas:char;
                umur:integer;
begin
clrscr;
writeln(‘~~~~~~~~~~~~~~~Identitas Diri Siswa~~~~~~~~~~~~~~~~~’);
writeln(‘Gunakan Kata-Kata ‘);
write(‘Nama                      : ‘);readln(nama);
write(‘Sekolah                  : ‘);readln(sekolah);
write(‘Jurusan                   : ‘);readln(jurusan);
write(‘Agama                    : ‘);readln(agama);
writeln(‘Gunakan Satu Huruf [ contoh = x ]’);
write(‘Kelamin L/W         : ‘);readln(kelamin);
write(‘Kelas                        : ‘);readln(kelas);
writeln(‘Gunakan Angka’);
writeln(‘Umur                   : ‘);readln(umur);
writeln(‘’);
writeln(‘Nama Anda ‘,nama,’ Bersekolah di ‘,sekolah,’ Jurusan ‘,jurusan );
writeln(‘Anda Kelas ‘,kelas,’ Beragama ‘,agama,’ Dengan umur ‘,umur );
readln;
end.

Jika Ada KEsalahan Mohon Komen >_<

No comments:

Post a Comment