package com.javainhouse;
public static void main(String[] args)
{
int test=5;
for (int i=1;i<test;i++)
{
int j=1;
for ( j=1;j<i;j++)
{
System.out.print(j);
}
for (int k=j;k>0;k--)
{
System.out.print(k);
}
System.out.println();
}
|
OutPut:
1
121
12321
1234321
Post a Comment