I am new to C++ ( I am a Java developer) and studying it by my self. I need to seperate the following number “12345” into indivudial numbers, which means in this case 1, 2, 3, 4, and 5. My book says it can be done by without the help of any inbuilt c++ method. How is that? Please help! And I found that modulo and devision can help. But how? I don’t know! Please help!
Share
Keep dividing (/) the number by 10. The remainders (%) of each division give you the digits in reverse order.