I want to get the decimal digits separately when I get the number. For example, if I get 123 or 321, I want to sort the array or print the digits "1 2 3" or "3 2 1" in C.
Would you please give me some any advice? Use C grammar?
int nums;
scanf("%d", &nums) // imagin this nums is 123
// and how can I get the number 1,2,3?
In the array. I will sort the number like
for(int i = 0; i<3; i++)
array[i] = nums;
and I expect in the array number is probably {1,2,3};