I was trying to print the star pattern in Java but it is not working properly. Herewith I have attached by code:
public class q3 {
public static void main(String[] args) {
for (int i = 10; i >= 1; i--){
for (int j = i; j >= 1; j--){
System.out.print("*");
}
System.out.println("");
}
}
}
Can anyone help me with this?