write a program in java to print this series.
123454321
1234 4321
123 321
12 21
1 1
Answers
Answered by
2
public class pattern_1
{
public static void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=i;j>=1;j--)
{
System.out.print(i);
}
System.out.print("\n");
}
}
}
u can write similar program to display output
this is just an example.
{
public static void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=i;j>=1;j--)
{
System.out.print(i);
}
System.out.print("\n");
}
}
}
u can write similar program to display output
this is just an example.
Similar questions