I already tried looking for this and they gave me to just do along the lines of:
int x = 1;
while (x != 11)
{
x = x * 10 + (x+1);
}
cout<<x;
output: 12345678910
While this is good and all I have the problem that if the first number is a zero, it ignores that. so it would do
0 * 10 + (0+1)
which would come out to "1" not "01". Is there a good alternative way to add numbers together in this manner?