# Can a scanf function see a number input "1234" as 4 separate numbers?

This is a discussion on Can a scanf function see a number input "1234" as 4 separate numbers? within the C Programming forums, part of the General Programming Boards category; Here's my answer to my C course question. I'm proud, even though it's only small. It does what I think ...

1. Here's my answer to my C course question. I'm proud, even though it's only small. It does what I think the original question is:

Code:
```	EE Programming Fundamentals Lab 3
Question 4
*/

#include <stdio.h>

int main(void)
{
int inNum, outNum[4];

do {
printf("Enter a 4-digit number: ");
scanf("%d", &inNum);
} while ((inNum < 1000) || (inNum > 9999));

outNum[0] = inNum/1000;
inNum -= 1000*(inNum/1000);

outNum[1] = inNum/100;
inNum -= 100*(inNum/100);

outNum[2] = inNum/10;
inNum -= 10*(inNum/10);

outNum[3] = inNum;

printf("Your number is %d %d %d %d.\n",outNum[0], outNum[1], outNum[2], outNum[3]);

return 0;
}

/*End of programme*/```

2. Output:

Code:
```[ec09411@dil015 3_4]\$ ./Lab3_4
Enter a 4-digit number: 6546
Your number is 6 5 4 6.
[ec09411@dil015 3_4]\$```

Page 3 of 3 First 123