[[1]: https://i.stack.imgur.com/BOAxI.jpg
]
java its * pattern problem and when I run this code in intellij idea the pattern print in vertical straight line , I don't know why its happening , someone help!
public class Main {
public static void main(String[] args) {
pattern1(4);
}
static void pattern1(int n) {
for (int row = 1; row <= n ; row++) {
for (int col = 1; col <= row ; col++) {
System.out.println("*");
}
System.out.println();
}
}
Aucun commentaire:
Enregistrer un commentaire