0
1.9kviews
Write a java program to print the following pattern (take input for number of rows from the command line)

enter image description here

Marks: 5 M

Year: May 2015

1 Answer
0
14views
Import java.io.*;
Class NumberTriangle
{
    Public static void main (String args[]) 
    {

        Int num = Integer.parseInt(args[0]));
        for (int i=1; i<=num; i++)
        {
            for(int j=1; j<=i; j++)
            {
                System.out.println (ā€œ+i+ā€);
            }
            System.out.println(ā€œ\nā€);
        }
    }
}
Please log in to add an answer.