Java Program – Pattern Printing Program – 2

To print the following pattern:

1 1 1
2 2 2
3 3 3
4 4 4

//Program to print the following pattern
/*
1  1  1
2  2  2
3  3  3
4  4  4
*/

class Pattern2
{	
	public static void main(String args[])
	{
		int r, c;

		for (r = 1; r <= 4; r++)
		{
			for (c = 1; c <= 3; c++)
			{
				System.out.print(r + "\t");
			}  //end of for-c loop

			System.out.println();

		}   //end of for-r loop

	} //end of main()

} //end of class
%d