Print the following in java -
1
121
12321
1234321
12321
Answers
Answered by
5
Answer:
class pattern_E
{
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
Chemistry,
6 months ago
CBSE BOARD XII,
6 months ago
Hindi,
6 months ago
Science,
11 months ago
Computer Science,
1 year ago