Originally Posted by
Adak
123456 - The input
My thinking goes like this:
#1.
for every digit in the set of digits, print it, then print a space
#2.
for(every digit in the set of digits)
....print the digit and a space
#3.
for(i equals first digit, i is less than or equal to 6, increment i)
....printf(the digit and 1 space)
Ready to code up the loop.
It's odd to take it through these steps, because with practice, you just say "got it", and code it. But the process REALLY comes into play with any problem where you don't have an answer.
Failing anything better, start with how YOU would do it, and take that logic step by step, to your program.