For this Question: Given a positive integer N, your task is to print a Pyramid pattern of '*' of height N.

For N = 5, the following pattern is printed.
 <center>    *    </center>
<center>   ***   </center>
<center>  *****  </center>
<center> ******* </center>
<center>*********</center>The input contains N as an input.

</b>Constraint:</b>
1 <b>&le;</b> N <b>&le;</b> 50Print a Pyramid pattern of '*' of height N.Sample Input:
5

Sample Output:
<center>    *    </center>
<center>   ***   </center>
<center>  *****  </center>
<center> ******* </center>
<center>*********</center>

Sample Input:
2

Sample Output:
<center>    *    </center>
<center>   ***   </center>, I have written this Solution Code: import java.util.*;

public class Main
{
    
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        for(int i=1;i<=n;i++){
            int cnt=2*i-1;
            for(int j=0;j<n-i;j++)System.out.print(" ");
            for(int j=0;j<cnt;j++)System.out.print("*");
            for(int j=0;j<n-i;j++)System.out.print(" ");
            System.out.println("");
        }
        System.out.println("");
        return;
    }
}

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