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

Follow our Network

Contoh Program Medium: Matrix TPW bag.10

0

Label:

Reaksi: 


------------------------------------------------------------------------
Program matrix;
Uses wincrt;
Var
data:array[1..100,1..100] of integer;
i,j,n,m,a:integer;
Begin
  Write('jumlah baris: ');readln(n);
   Write('jumlah kolom: ');readln(m);
   Writeln;
   Writeln('matrix ber-ordo ',n,'x',m);


For i:=1 to n do
  For j:=1 to m do
    Begin
       Write('Data[',i,',',j,']: ');readln(data[i,j]);
    End;
   Writeln;
   For i:=1 to n do
   Begin
     For j:=1 to m do
      Begin
         Write(data[i,j]:6);
      End;
      Writeln;
   End;
       Writeln;
       writeln('Makasih Yach Udah pake Program Ini..!!');
    Readln;
    Readln;
Donewincrt;
End.

--------------------------------------------------------------------------
Program Matrix_Identitas;
Uses wincrt;
Var
i,j,n,m:integer;
data : array [1..5,1..5] of integer;
begin
  write('banyaknya kolom = ');readln(n);
  write('banyaknya baris = ');readln(m);

if n=m then
begin
for i:=1 to n do
    for j:=1 to m do
       begin
       if i=j then
             data[i,j]:=1
       else
             data[i,j]:=0
       end;
writeln;
writeln('hasil matrix identitasnya');
for i:=1 to n do
begin
for j:=1 to m do
   begin
        write(data[i,j]:7);
     end;
writeln;
end;

end
else
   begin
     writeln;
     writeln('matrix identitas harus merupakan matrix simetris!');
   end;
end.

-----------------------------------------------------------------------------------
Program Penjumlahan_Matrix;
Uses wincrt;
Var
Mat_A,Mat_B,Mat_C:array[1..5,1..5]of integer;
i,j:integer;
const
x=2;
y=2;

begin
    writeln('Matrix A');
    for i:=1 to x do
      for j:=1 to y do
         begin
            write('[',i,',',j,']:');readln(Mat_A[i,j]);
         end;

writeln('Matrix B');
for i:=1 to x do
   for j:=1 to y do
    begin
     write('[',I,',',j,']:');readln(Mat_B[i,j]);
    end;

for i:=1 to x do
  for j:=1 to y do
    Mat_C[i,j]:=Mat_A[i,j]+Mat_B[i,j];

Writeln('Hasil Penjumlahan');
For i:=1 to x do
  Begin
  For j:=1 to y do
    Begin
      Write(Mat_C[i,j]:4);
    End;
  Writeln;
  End;
Readln;
Donewincrt;

End.

-------------------------------------------------------------------------------------------
created by : MuchFa (Tio Muchtar)
NB: mangga di copy paste, mung tong hilap dicantumkeun pangarang sareng link na nya..!! Hatur Nuhun..

Comments (0)

Posting Komentar

Social Media

  • Subscribe via email

    Enter your email address:

    Delivered by FeedBurner

    Techno 4 U