public class PrintPatterns{ public static void main(String[] args){ //Init variables int i,count,row; row = 1; for(count = 1; count <= row; count++){ for(i = 1; i <= row; i++){ System.out.print(i+" "); } if(row < 6) row++; System.out.println(" "); } } }