Program to print a patter in java
12345
12354
12543
15432
Answers
Answered by
2
Explanation:
class Pattern
{
public static void main (String args [])
{
for(int i=1;i<5;i++)
{
for(int j=1;j<=(5-i);j++)
System.out.print(j);
for(int k=5;k>(5-i);k--)
System.out.print(k);
System.out.println();
}
}
}
Some additional information:
*java is a high level language.it is an object oriented language.
*java is a case sensitive language.
*java is one of the most popular languages in the world.
*java is platform independent Language.
*java is a robust language.
Attachments:
Similar questions