taking input
int nsp = 0;
int nst = n;
for(int row = 1; row <= n ; row++){
for(int csp =1; csp <= nsp ; csp++){
System.out.print(" “);
}
for(int cst = 1; cst <= nst ; cst++){
System.out.print(”*");
}
System.out.println();
row ++;
nst–;
nsp++;
}