Mesran

Hanya ingin berbagi kebaikan dan mendapatkan kebaikan yang lain.

LATIHAN LATIHAN PASCAL

Biasanya anda hanya menggunakan CRT saja di dalam pemrograman Pascal, nah sekarang kita mencoba menggunakan DOS.

Ketikkanlah program berikut di bawah ini :

USES Dos, Crt;

VAR
h, m, s, hund : Word;

FUNCTION LeadingZero(w : Word) : String;
VAR
s : String;
BEGIN
Str(w:0,s);
if Length(s) = 1 then
s := '0' + s;
LeadingZero := s;
END;

BEGIN
clrscr ;
REPEAT
GetTime(h,m,s,hund);
Gotoxy ( 25, 10) ; Write('Jam Sekarang :  ', LeadingZero(h), ':',
LeadingZero(m), ':', LeadingZero(s),
'.', LeadingZero(hund) ) ;
UNTIL Keypressed ;

END.

Hasilnya yaitu ?

Filed under: Pemrograman Pascal,

Terima kasih telah memberikan komentar anda.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives Per Tahun

Sponsored

C&C Online Shop

Blog Stats

  • 356,504 sejak 12 Jan 2011

User’s Online


My Music

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 223 other followers

February 2011
M T W T F S S
« Jan   Mar »
 123456
78910111213
14151617181920
21222324252627
28  
%d bloggers like this: