How can I split an int in c++ to its single numbers? For example, I\'d like to split 23 to 2 and 3.
A simple answer to this question can be:
I Think It Will Help. I Used Simple Code Like:
#include
using namespace std;
int main()
{int n,r;
cout<<"Enter Your Number:";
cin>>n;
while(n!=0)
{
r=n%10;
n=n/10;
cout<