the second group pf stars is not appearing even though i have written the same code. it is as copied below:
package practicequestions;
import java.util.Scanner;
public class pq17 {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int row=1;
int nst=n/2;
int nsp=1;
while(row<=n) {
int cst=1;
int csp=1;
while(cst<=nst) {
System.out.print("*");
cst++;
}
while(csp<nsp) {
System.out.print(" ");
csp++;
}
while(cst<=nst) {
System.out.print("*");
cst++;
}
System.out.println();
if(row<=n/2) {
nst=nst-1;;
nsp=nsp+2;
}
else {
nst=nst+1;
nsp=nsp-2;
}
row++;
}
}
}