int n = 7;
int row = 1;
while(row <= n) {
int col = 1;
while(col <= row) {
System.out.print("* ");
col++;
}
System.out.println();
row++;
}
I have gotten the exact same answer using this code, So I was wondering whether the use of the extra variable nst is beneficial in some way?