For this Question: Given a matrix of N*N dimensions (Mat). Print the matrix rotated by 90 degrees and 180 degrees.The first line contains N. 
N lines follow each containing N space-separated integers.

<b>Constraints</b>
2 <= N <= 100
1 <= Mat[i][j] <= 10000Output 2*N+1 lines. 
First N lines should contain the Matrix rotated by 90 degrees.
Then print a blank line.
Then N lines should contain the Matrix rotated by 180 degrees.Sample Input 1:
2
3 4 
7 6 

Sample Output 1:
7 3 
6 4 

6 7 
4 3

Sample Input 2:
2
1 2
3 4

Sample Output 2:
3 1
4 2

4 3
2 1, I have written this Solution Code: 
import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		
	int n = sc.nextInt();
	int a[][] = new int[n][n];
	for(int i=0;i<n;i++){
	    for(int j=0;j<n;j++){
	        a[i][j]= sc.nextInt();
	    }
	}
	//rotating by 90 degree
	for (int i = 0; i < n / 2; i++) {
        for (int j = i; j < n - i - 1; j++) {

            
            int temp = a[i][j];
            a[i][j] = a[n - 1 - j][i];
            a[n - 1 - j][i] = a[n - 1 - i][n - 1 - j];
            a[n - 1 - i][n - 1 - j] = a[j][n - 1 - i];
            a[j][n - 1 - i] = temp;
        }
    }
    for(int i =0;i<n;i++){
        for(int j=0;j<n;j++){
            System.out.print(a[i][j]+" ");
        }
        System.out.println();
    }
    //rotating by 90 degree
	for (int i = 0; i < n / 2; i++) {
        for (int j = i; j < n - i - 1; j++) {

            
            int temp = a[i][j];
            a[i][j] = a[n - 1 - j][i];
            a[n - 1 - j][i] = a[n - 1 - i][n - 1 - j];
            a[n - 1 - i][n - 1 - j] = a[j][n - 1 - i];
            a[j][n - 1 - i] = temp;
        }
    }
    System.out.println();
    for(int i =0;i<n;i++){
        for(int j=0;j<n;j++){
            System.out.print(a[i][j]+" ");
        }
        System.out.println();
    }
    
    
	

}
	    


}, In this Programming Language: Java, Now tell me if this Code is compilable or not?