
1 212
32123 4321234 543212345 4321234 32123 212 1

Here is a code that displays the following pattern:
1
212
32123
4321234
543212345
4321234
32123
212
1
class Pattern{
public static void main(String args[]){
int i,j,k,l;
for(i=1;i<6;i++){
for(j=5;j>i;j--)
System.out.print(" ");
for(k=i;k>=1;k--)
System.out.print(k);
for(l=2;l
System.out.print(l);
System.out.println("");
}
for(i=1;i<5;i++){
for(j=i;j>=1;j--)
System.out.print(" ");
for(k=5-i;k>=1;k--)
System.out.print(k);
for(l=2;l<6-i;l++)
System.out.print(l);
System.out.println("");
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.