- 1
Wap to print
* ** *** ****
1 Answer
0
Try this.
class Star{
public static void main(String[] args) {
int num = 10;
for (int i = 0;i<num ;i++ ) {
for (int j = num;j!=0 ;j-- ) {
System.out.print(" ");
}
for (int k = 0;k<i ;k++ ) {
System.out.print("*");
}
num--;
System.out.println();
}
}
}