if i use this code
package javacrux;
import java.util.Scanner;
public class pattern0 {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n= scn.nextInt();
for(int row=1 ; row<=n ; row++) {
for(int col=1 ; col<row ;col++) {
System.out.print("*");
}
System.out.print("*");
System.out.print("\n");
}
}
}
then its giving the same output
plz tell me that this is correct or incorrect