Putting the value of two integers together

I have a question how would it be possible to put to integers together.
So for example lets say the had the number 1 and the number 2. If you where to add the result you would get 3 however I am just curious how could you get 12 from that.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <sstream>

using namespace std;

int main ()
{
	int lol = 32;
	int lold = 32;
	int jew = 0;
	jew = lol && lold;
	cout << jew << endl;
	return 0;
};
How would you solve this if it was a math problem?
This is not a math problem I am asking simply how these two integers can be put together.
If this is not homework:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <string>

int main()
{
    const unsigned int a = 123, b = 45678 ;
    
    // http://en.cppreference.com/w/cpp/string/basic_string/to_string
    // http://en.cppreference.com/w/cpp/string/basic_string/stoul
    unsigned long long cat = std::stoull( std::to_string(a) + std::to_string(b) ) ;
    
    std::cout << a << " cat " << b << " => " << cat << '\n' ;
}

http://coliru.stacked-crooked.com/a/2c9ef65beaf5620c
Topic archived. No new replies allowed.