
Hi,
Can any one please share a code to print the below:
1 121 12321 1234321

class GeneratOutPut {
public static void main(String args[]) {
for(int i=1;i<=4;i++) {
String str="";
for(int j=1;j<i;j++)
str+=j;
str+=i;
for(int k=i-1;k>=1;k--)
str+=k;
System.out.print(str+" ");
}
} }
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.