while loop or doo loop
the output should be like this

1
12
123
1234
123
12
1

and

1234
123
12
1
12
123
1234

tnx

Yes, I and others here, know how to do it.
What have you done so far?
Show us your attempt, your effort. Without it I fear none of us will be able to help you.

As always, show us your best attempt and we'll help/guide/assist you. Just asking us to do it won't work. We like to see a little effort on your part:)

I thought this looked familiar. Exact same response here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.