how to separate number in C [closed]

-2

I wanted to ask if anyone can think of how I can show a number that I receive per ticket, for example if I receive 2354, how can I show it like this: 2 3 5 4. Separated by spaces

thanks in advance

    
asked by Alejandro Rebolo 10.06.2018 в 02:24
source

1 answer

-2

This code is for flipping a digit number by digit:

int x=2345,y=0,d=0;
while(x>0)
{
    d=x%10;
    y=y*10+d;
    x=(x-d)/10;
}

'd' is the digit and each time it changes,

    
answered by 10.06.2018 / 16:07
source