Print the pattern:
12345
12355
12555
15555
55555
Answers
Answered by
3
Answer:
public class HelloWorld{
public static void main(String []args){
for(int i=5;i>=1;i--)
{
for(int j=1;j<i;j++)
System.out.print(j);
for(int k=i;k<=5;k++)
System.out.print("5");
System.out.println();
}
}
}
Explanation:
I have written in JAVA
You can use the logic in any programming language
Hope it helps :-)
Similar questions