Regarding error in pattern

can u plz tell why this code is becoming infinite?
public class Patterntype1 {
public static void main(String args[]) {
Scanner sc= new Scanner(System.in);
int s = sc.nextInt();
int row=1;
int nst=s;
while(row<=s) {
//work
int cst=1;
while(cst<=nst) {
System.out.print("*");
}

	System.out.println();
	 row=row+1;
	 nst=nst-1;
 }

}

Hello Ishant,in the while loop increment the value of cst ie put cst++.

Hi Ishant,
as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.