hey sir i am having problem in splitting a number into its digits if i use remainder and division operation then i can split a number and print it in reverse order but dont know how to split that number and print that in correct order
here is my program
#include<iostre am>
using namespace std;
int main()
{
int x=12345,r,c=1;
while(c<=5){
r=x%10;
x=x/10;
cout<<r;
c++;
}
cin.get();
return 0;
}
here is my program
#include<iostre am>
using namespace std;
int main()
{
int x=12345,r,c=1;
while(c<=5){
r=x%10;
x=x/10;
cout<<r;
c++;
}
cin.get();
return 0;
}
Comment