wap in java to print the pattern
1
121
12321
1234321
123454321
1234321
12321
121
1
Answers
Answered by
0
Answer:
Explanation:
class pattern_1_121_12321
{
public static void pattern(int no)
{
int n=1;
for(int p=1;p<=no;p++)
{
for (int i=no;i>=1;i--)
{
System.out.print(" ");
}
System.out.println("");
for(int m=1;m<=p;m++)
{
System.out.print(m);
}
for(int y=p-1;y>=1;y--)
{
System.out.print(y);
}
System.out.println("");
}
}
}
Similar questions