Mesran

Hanya ingin berbagi kebaikan dan mendapatkan kebaikan yang lain.

Mencari Bilangan Terkecil dan Terbesar (PASCAL)

Dibawah ini program untuk mencari bilangan terbesar dan terkecil.

Web Hosting Murah Indonesia | Web Hosting Murah dan Handal

Uses crt;
Var bil:array[1..100] of integer;
max,min,i,n:integer;

Begin
     Write('Masukkan jumlah bilangannya gan = '); readln(n);
     Max:=1;
     Min:=30000;

     For i:=1 to n do
     Begin
          {Menginputkan Nilai Bilangan Ke I}
          Write('Bilangan ke ',i,' = '); readln(bil[i]);

          {Mencari Bilangan Terbesar}
          If bil[i]>Max then Max := bil[i] ;

          {Mencari Bilangan Terkecil}
          If bil[i]<Min then Min := bil[i] ;

     End;

     Writeln('Bilangan Terbesar = ', Max);
     Writeln('Bilangan Terkecil = ', Min);
     Readln ;
End.
Selamat Mencoba :D

Artikel Terbaru


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

  • 355,762 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

October 2011
M T W T F S S
« Sep   Nov »
 12
3456789
10111213141516
17181920212223
24252627282930
31  
%d bloggers like this: