Patterns: ========= Right side Right angled Triangle. class LeftRightAngledTriangle{ public static void main(String[] args) { // we need to iterate on rows first int rows = 5; for(int r = 1;r <= rows;++r) { //printing of spaces for(int s = 1;s <= 2*(rows-r);s++) { System.out.print(" "); } for(int c = 1;c <= r;c++) { System.out.print("* "); } System.out.println(); } } } ========================================= class pyramidPattern{ public static void main(String[] args) { int rows = 6; // row operation for(int r = 0;r < rows ;r++) { // printing of spaces for(int s = (rows - r);s > 1;--s) { System.out.print(" "); } // printing 0f * for(int c = 0;c <= r;++c) { System.out.print("* "); } System.out.println(); } } } ============================================== Assignment: =========== 1) 1 2 2 3 3 3 2) * * * * * * * * * * * * * * *