here is java code that prints triangles one below each other, naming them A, B, C, D; my question is how to print them on*the same level*
public class ex_5_10 {
public static void main(String args[]){
// (A)
System.out.println("(A)") ;
for(int row = 0 ; row < 10 ; row++){
for(int column = 0 ; column < 10 ; column++){
if(column > row) continue ;
System.out.print("*");
}
System.out.println() ;
}
//*********************************
// (B)
System.out.println("(B)") ;
for(int row = 0 ; row < 10 ; row++){
for(int column = 0 ; column < 10 ; column++){
if(column < row) continue ;
System.out.print("*");
}
System.out.println() ;
}
//********************************
//(C)
System.out.println("(C)") ;
for(int row = 0 ; row < 10 ; row++){
for(int column = 0 ; column < 10 ; column++){
if( column < row ) System.out.print(" ") ;
else System.out.print("*");
}
System.out.println() ;
}
// (D)
System.out.println("(D)") ;
for(int row = 0 ; row < 10 ; row++){
for(int column = 10 ; column >= 0 ; column--){
if( column > row ){ System.out.print(" ") ; }
else {System.out.print("*"); }
}
System.out.println() ;
}
}
}
so the java code above will print this:
*
**
***
***
**
*
***
**
*
*
**
***
now i need to print same figures on the same level!
* *** *** *
** ** ** **
*** * * ***
please help me! i m looking for your answer! thanks in advance