- - - - - - - - - *
- - - - - - - - * *
- - - - - - - * * *
- - - - - - * * * *
- - - - - * * * * *
- - - - * * * * * *
- - - * * * * * * *
- - * * * * * * * *
- * * * * * * * * *
* * * * * * * * *
Can anybody help me out? actually i want * to be printed at the end blank space.
public static void main(String[] args) {
int x=10, a=0;
for (int i = 1; i<= x; i++) {
for (int k = 1; k<=x-i ; k++) {
System.out.print("- ");
a =k;
}
// System.out.println("");
for (int j = a+1; j <=x; j++) {
System.out.print("*");
System.out.print(" ");
}
System.out.println("");
}
}