Check my code and tell me about any problem in it..i have used 1 less variable...cst variable not used

Scanner s = new Scanner(System.in);

	int n = s.nextInt();
	int row = 1;

	while (row <= n) {
		int nst = 1;

		while (nst <= row) {
			System.out.print("*");
			nst++;
		}
		System.out.println();
		row++;
	}

same pattern is printed but not using cst variable…

Hii Nipun,
If you are printing pattern like:-
*
**


And so on, then your code is correct.

Hey Nipun,
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.