RSS FEED

counter

program perkalian matrix

program perkalian_matriks;
var
i,j,x,y,baris,kolom:integer;
a:array[1..10,1..10]of integer;
b:array[1..10,1..10]of integer;
c:array[1..10,1..10]of integer;
begin

writeln(’ Masukkan Nilai Matriks Pertama : ‘);
write(’ Masukkan Jumlah Baris : ‘);readln(i);
write(’ Masukkan Jumlah Kolom : ‘);readln(j);
for baris := 1 to i do
begin
for kolom := 1 to j do
begin
write(’ Data Pertama[’,baris,’,',kolom,’] : ‘);readln(a[baris,kolom]);
end;
writeln;
end;
for baris := 1 to i do
begin
for kolom := 1 to j do
begin
write(”,a[baris,kolom],”);
end;
writeln;
end;

begin
writeln(’ Masukkan Nilai Matriks Kedua : ‘);
write(’ Masukkan Jumlah Baris : ‘);readln(y);
write(’ Masukkan Jumlah Kolom : ‘);readln(x);
for baris := 1 to y do
begin
for kolom := 1 to x do
begin
write(’ Data Kedua[’,baris,’,',kolom,’] : ‘);readln(b[baris,kolom]);
end;
writeln;
end;
for baris := 1 to y do
begin
for kolom := 1 to x do
begin
write(”,b[baris,kolom],”);
end;
writeln;
end;
end;

if (i=y) and (j=x) then
begin
writeln(’ Syarat penjumlahan matriks terpenuhi’);
for baris := 1 to y do
begin
for kolom := 1 to x do
begin
c[baris,kolom] := a[baris,kolom]*b[kolom,baris];
end;
writeln;
end;
for baris := 1 to y do
begin
for kolom := 1 to x do
begin
write(”,c[baris,kolom],”);
end;
writeln;
end;
end
else
begin
writeln(’ Syarat penjumlahan matriks tidak terpenuhi’);
end;
end.

program perkalian matrix

program perkalian_matriks;
var
i,j,x,y,baris,kolom:integer;
a:array[1..10,1..10]of integer;
b:array[1..10,1..10]of integer;
c:array[1..10,1..10]of integer;
begin

writeln(’ Masukkan Nilai Matriks Pertama : ‘);
write(’ Masukkan Jumlah Baris : ‘);readln(i);
write(’ Masukkan Jumlah Kolom : ‘);readln(j);
for baris := 1 to i do
begin
for kolom := 1 to j do
begin
write(’ Data Pertama[’,baris,’,',kolom,’] : ‘);readln(a[baris,kolom]);
end;
writeln;
end;
for baris := 1 to i do
begin
for kolom := 1 to j do
begin
write(”,a[baris,kolom],”);
end;
writeln;
end;

begin
writeln(’ Masukkan Nilai Matriks Kedua : ‘);
write(’ Masukkan Jumlah Baris : ‘);readln(y);
write(’ Masukkan Jumlah Kolom : ‘);readln(x);
for baris := 1 to y do
begin
for kolom := 1 to x do
begin
write(’ Data Kedua[’,baris,’,',kolom,’] : ‘);readln(b[baris,kolom]);
end;
writeln;
end;
for baris := 1 to y do
begin
for kolom := 1 to x do
begin
write(”,b[baris,kolom],”);
end;
writeln;
end;
end;

if (i=y) and (j=x) then
begin
writeln(’ Syarat penjumlahan matriks terpenuhi’);
for baris := 1 to y do
begin
for kolom := 1 to x do
begin
c[baris,kolom] := a[baris,kolom]*b[kolom,baris];
end;
writeln;
end;
for baris := 1 to y do
begin
for kolom := 1 to x do
begin
write(”,c[baris,kolom],”);
end;
writeln;
end;
end
else
begin
writeln(’ Syarat penjumlahan matriks tidak terpenuhi’);
end;
end.

program bilangan prima

Program bilangan_prima;
var bil: integer;
begin

write(’ Masukkan angka: ‘);readln(bil);
if ((bil=2) or (bil=3) or (bil=5) or (bil=7)) then
write(’ bilangan prima’)
else if ((bil mod 2 <> 0) and (bil mod 3 <> 0) and (bil mod 5 <> 0) and (bil mod 7 <> 0)) then
write(’ bilangan prima’)
else write(’ bukan bilangan prima’);
readln;
end.
Return top