-->

Thursday, August 20, 2015

12345 printing in triangle using java

class No_s_print
{
    public static void main(String [] args)
        {
                    for(int row=1; row<= 5 ;row++)
                {
                                    for(int col=0; col < row; col++)
                        {
                                            System.out.print(col+1+" ");
                                           }
                                        System.out.println(" ");
                           }
        }
}

No comments:

Post a Comment

JavaScript Free Code