viewing paste PrintPatterns | Java

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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(" ");        
        }
    }
        
}
Viewed 734 times, submitted by Guest.