Pertemuan I dan II

materi pertemuan pertam struktur data dapat dilihat di link ini Silabus Struktur Data

Materi pertemuan kedua Pertemuan II-Alur Pemrograman Edit

 

Contoh Program Array mencari nilai rata-rata

Program array_rata_bilangan;
Uses wincrt;

Var

s:array [1..100] of 0..100;
n,i:integer;
rata2,jum:real;

Begin

Write(‘Banyaknya bilangan:’);
Readln(n);
For i:=1 to n do
Begin

Clrscr;
Write(‘Bilangan ke’,i,’:’);
Readln(s[i]);

End;
For i:=1 to n do
Begin

Writeln(i,’.’,s[i]:7);
Jum:=jum+s[i];

End;
Rata2:=jum/n;
Write(‘rata-rata :’,rata2:2:2);

End.

3 thoughts on “Pertemuan I dan II

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