Computer Science Blog

June 13, 2007

Array

Filed under: Pascal Programming

Tipe data array menyimpan data dengan tipe yang sama.

Deklarasi Tipe :

Type nama = array [indeks] of tipe data;

 

Deklarasi Variabel :

Var nama : array[indeks] of tipedata

 

CONTOH:

uses wincrt;

var L : array[1..20] of integer;
    i,n : byte;

begin
     write(’Berapa banyak data : ‘);readln(n);
     for i:=1 to n do
     begin
          write(’Data ke - ‘,i ,’ adalah : ‘);
          readln(L[i]);
     end;
     write (’Data yang dimasukkan adalah : ‘);
     for i :=1 to n do
     write(L[i]:2);
     readln;
     donewincrt;
     readkey;

end.

Comments »

The URI to TrackBack this entry is: http://gudeg.blogsome.com/2007/06/13/array/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