Please help me in solving the java progarm :-
1_______1
12_____21
123___321
1234_4321
123454321
Here underscore (_) means 1 space
Answers
Answered by
0
Answer:
public class Main-class
{
public static void main(String args[])
{
for(int i=1;i<=5;i++)
{
int t=1;
for(int j=5;j<=i;j–)
{
System.out.print(t);
t++;
}
for(int sp=1;sp<i;sp++)
System.out.print("*");
System.out.println();
}
int x=4;
for(int a=1;a=1;s–)
System.out.print(s);
}
else
{
int y=x;
for(int h=1;h=a;b++)
{
System.out.print(y);
y–;
}
System.out.println();
x–;
}
}
}
}
Similar questions