class yusuf
{
public static void main(String[] args)
{
int x,y;
int[][] tabel = {{3,2,5},{4,5,6},{1,2,6}};
int[][] tabel2 = {{1,2,3},{2,3,1},{3,2,4}};
System.out.println("Matrik 1");
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
System.out.print(tabel[i][j]+" ");
}
System.out.println();
}
System.out.println("Matrik 2");
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
System.out.print(tabel2[i][j]+" ");
}
System.out.println();
}
System.out.println("Matrik penjumlahan");
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
x=tabel[i][j]+tabel2[i][j];
System.out.print(x+ " ");}
System.out.println();
}
System.out.println("Matrik pengurangan");
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
y=tabel[i][j]-tabel2[i][j];
System.out.print(y+ " ");}
System.out.println();
}
}}