Pattern Program #3 || Pattern Program in JAVA || BluejCode
Pattern Program #3
Pattern |
Program :-
class Pattern5
{
public static void main(String args[])
{
int i,j,a=1;
for(i=1;i<=5;i++) // Loop for No. of rows
{
a=i;
for(j=1;j<=5;j++) //Loop for No. of columns
{
if(a<j)
{
a++;
System.out.print(a+"\t");
}
else
{
System.out.print(a+"\t");
}
}
System.out.println();
}
} // end of main method
} // end of class
Comments
Post a Comment