Computer Science Blog

June 13, 2007

Program Maksimum Minimum

Filed under: Pascal Programming

uses wincrt;

   var
     L : array[1..100] of integer;
     i,n : byte;
     mak, min : byte;

   begin
        write(’Masukkan jumlah data : ‘);
        readln(n);

        randomize;

        writeln(’Data ke yang dimasukkan adalah ‘);

        for i:=1 to N do
        begin
             L[i]:=random(100)+1;
             write(L[i]:4);
        end;

        Mak := L[1];
        Min := L[1];

        for i:=2 to N do
        begin
             if mak < L[i] then
                mak := L[i]
             else if min > L[i] then
                min := L[i];
        end;

        writeln;
        writeln(’Nilai Maksimal nya adalah ‘,mak);
        writeln(’Nilai Minimal nya adalah ‘,min);

        readkey;
        donewincrt;
   end.

Comments »

The URI to TrackBack this entry is: http://gudeg.blogsome.com/2007/06/13/program-maksimum-minimum/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Jay of onefinejay.com