Social Icons

Monday, April 22, 2013

Program Menghitung Jumlah Bilangan Perulangan FOR Dengan Nilai Statis


————————————————————————————————————————
program jum_bil;
uses wincrt;
var
i, jum,bil: integer;
begin
jum:=0; {inisialisasi}
for i:=1 to 5 do
begin
write(‘Masukkan Bilangan = ‘);readln(bil);
jum:=jum+bil;
end;
writeln(‘Jumlah Bilangan = ‘,jum);
end.
OUTPUT PROGRAM
===========================================================
Masukkan Bilangan = 12
Masukkan Bilangan = 12
Masukkan Bilangan = 12
Masukkan Bilangan = 12
Masukkan Bilangan = 12
Jumlah Bilangan = 60

No comments:

Post a Comment

 
Blogger Templates