Simple-Determinant
Problem Statement
You are given a 2X2 square matrix. You need to find the determinant of the matrix.
import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework
// don't change the name of this class
// you can add inner classes if needed
class Main {
public static void main (String[] args) {
// Your code here
Scanner sc = new Scanner(System.in);
int a[][]=new int[2][2];
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
a[i][j]=sc.nextInt();
}
}System.out.println((a[0][0] * a[1][1]) - (a[0][1] * a[1][0]));
}}