Program Bilangan Genap


uses wincrt;
var genap : array[1..100] of integer;
a, b, jum : integer;
begin
a := 0;
b := 2;
write(‘Jumlah bilangan genap : ‘);readln(jum);

while a jum do begin
inc(a);
genap[a] := b;
b := b + 2;
end;

writeln;
writeln(‘Hasil yang disimpan di array : ‘);
for b := 1 to jum do
writeln(‘Bilangan genap ke-‘,b,’ : ‘,genap[b]);
end.

Advertisements

Leave a Reply

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