1

Here's my understanding fetching the input:

int num = 0;
NSLog (@"Input 5 numbers");

scanf("%d", &num);


NSLog (@"\n You inputted: %d !", num);

Sample Input: 54321 Output: 54321

But the output should be:
5
4
3
2
1

1 Answers1

0

I see no one-line-code solution here. It can be achieved with for or while loop. e.g. you may divide num by 10 or convert it to string and fetch each character.

For an example of converting an NSString to a char array see here.

Community
  • 1
  • 1
heximal
  • 10,327
  • 5
  • 46
  • 69