i Write a program to check whether a matrix is an identity matrix but i do not
know how to find it
plz help me
this my code
package javaapplication162;
import java.util.Scanner;
public class JavaApplication162 {
public static void main(String[] args) {
Scanner input = new Scanner (System.in) ;
int [][] Diag = new int [3][3];
System.out.println(" Enter Number 3 rows and 3 columns ") ;
for (int i=0 ; i < Diag.length ; i++){
for (int j=0 ; j <Diag[i].length ; j++){
Diag[i][j]=input.nextInt();
}
}
for (int i=0 ; i < Diag.length ; i++){
for (int j=0 ; j <Diag[i].length ; j++){
if(Diag[i][i]==Diag[i][i]){
System.out.println(" yes it's a Identity matrix ") ;
}
else if(Diag[i][i]!=Diag[i][i]){
System.out.println(" No it's a Identity matrix ") ;
}
}
}
}
}