MENENTUKAN MATRIKS SIMETRI(JAVA)

import jeliot.io.*;

public class simetri{
 public static void main(String[] args){
    int baris,kolom;
     int matriks[][];
     matriks = new int[10][10];

     System.out.println("Masukkan jumlah baris :");
     baris = Input.readInt();

     System.out.println("Masukkan jumlah kolom :");
     kolom = Input.readInt();

     System.out.print("\n");

     for(int i=0; i<baris; i++){

          for(int j=0; j<kolom; j++){

          System.out.print("Masukkan baris " + i+1 + "kolom " + j+1 + "=");
          matriks[i][j] = Input.readInt();
            }
          }

      System.out.print("\n");
      for(int i=0; i<baris; i++){
         for(int j=0; j<kolom; j++){
           System.out.print(matriks[i][j] + " " );
                   }
         System.out.print("\n");
            }
        System.out.print("\n");

           if(baris==kolom){
               System.out.print("Matriks simetri");
                 }
             else {
                System.out.print("Bukan matriks simetri");
                    }
                }
              }
Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s