why are we not using space code again after the stars code like we have used previously ?
Scanner scn= new Scanner(System.in);
int n= scn.nextInt();
int nsp=n-1;
int nst=1;
int row=1;
while(row<=n) {
for(int csp=1;csp<=nsp;csp++) {
System.out.print(" “);
}for(int cst=1;cst<=nst;cst++) {
System.out.print(“1”);
}for(int csp=1;csp<=nsp;csp++) {
System.out.print(” ");
}System.out.println();
nst=nst+2;
nsp–;
row++;
}
}
}