Question: I've problem to merge 3 variable become in to one variable:

example :

```
int var1,var2,var3;
int result;
var1 = 1;
var2 = 2;
var3 = 3;

result = ........??;

printf("Result %d",result);

output :
123

```

How can I do this?

Answer: 
```
result = var1 * 100 + var2 *10 + var3;

```
If you do not know how many digits do the vars have you will have to go through stringstream:

```
#include <iostream>
#include <sstream>

using namespace std;

int main() {
        int a = 10;
        int b = 12;
        int c = 2;
        stringstream ss;
        ss << a << b << c;
        int merge;
        ss >> merge;
        cout << merge << endl;
        return 0;
}

```

Working example on [ideone](http://ideone.com/g3BxE).