• Twitter
  • Technocrati
  • stumbleupon
  • flickr
  • digg
  • youtube
  • facebook

Follow our Network

Contoh Program Array Sederhana TPW bag. 9

0

Label:

Reaksi: 


--------------------------------------------------------------------------
Program Input_array;
Uses wincrt;
Var
n,i:integer;
a:array[1..10] of integer;
begin
  write ('banyaknya data= ');readln(n);
for i:=1 to n do
begin
  write('data ke-',i, '=');readln(a[i]);
end;
writeln;
writeln('data yang anda masukan sebagai berikut: ');
for i:=1 to n do
 writeln(a[i]);
end.

-------------------------------------------------------------------------
Program Dengan_Array;
Uses wincrt;
Var
D:array[1..5] of integer;
Jumlah,i:integer;
Begin
Jumlah:=0;
For i:=1 to 5 do
Begin
Write ('data ke-',i,':');
Readln(D[i]);
Jumlah:=D[i]+jumlah;
End;
For i:=1 to 5 do
Writeln(D[i]);
Write('Jumlah array: ',jumlah);
writeln(' ');
writeln('Hatur Nuhun tos nganggo ieu program..!!');
End.

--------------------------------------------------------------------------

NB: you can copy paste, but remember..put writer's name and URL's..Ok thank you ^^

Comments (0)

Posting Komentar

Social Media

  • Subscribe via email

    Enter your email address:

    Delivered by FeedBurner

    Techno 4 U