BELAJAR ADALAH KENIKMATAN

Penjumlahan Matrik Pada C++

by e Best Materi , at Wednesday, November 03, 2010 , have 0 comments
#include <iostream.h>
#include <conio.h>

void main()
{
int matrix[20][30], matrix2[2][3],jumlah[2][3];
int i, j;

cout<<"Matrix A :";
cout<
<endl;
for (i=1;i<=2;i++)
    {
   for(j=1;j<=2;j++)
       {
       cout<<"Masukkan Nilai ["<<<"] ["<<<"] : ";
      cin>>matrix[i][j];
      }
   }




cout<<"-----------------------------------------------------";
cout<<"\nMatrix B :\n";
for (i=1;i<=2;i++)
    {
   for(j=1;j<=2;j++)
       {
       cout<<"Masukkan Nilai ["<<<"] ["<<<"] : ";
      cin>>matrix2[i][j];
      }
   }
cout<<"=====================================================";

 for (i=1;i<=2;i++)
    {
   for(j=1;j<=2;j++)
       {
       jumlah[i][j]=matrix[i][j] + matrix2[i][j];
      }
   }

 gotoxy(1,16);
 cout<<"C = ";
 for(i=1;i<=2;i++)
 {
  for(j=1;j<=2;j++)
  {
   gotoxy(3+4*j,13+2*i);
   cout<
<matrix[i][j];
  }
 }

 gotoxy(15,16);
 cout<<" + ";
 for(i=1;i<=2;i++)
 {
  for(j=1;j<=2;j++)
  {
   gotoxy(18+4*j,13+2*i);
   cout<
<matrix2[i][j];
  }
 }

 gotoxy(30,16);
 cout<<" = ";
 for(i=1;i<=2;i++)
 {
  for(j=1;j<=2;j++)
  {
   gotoxy(33+4*j,13+2*i);
   cout<
<jumlah[i][j];
  }
 }

getch();

}
e Best Materi
Penjumlahan Matrik Pada C++ - written by e Best Materi , published at Wednesday, November 03, 2010, categorized as C++ . And have 0 comments
No comment Add a comment
Cancel Reply
GetID
Theme designed by Damzaky - Published by Proyek-Template
Powered by Blogger