Get 2 digits out of an integer

Hello fellas, i want to get out 2 or more digits out of an number, for example 12345 i want to get out 23 and how i can do that? I know i can convert it into string and after some things to convert it back to int but i dont think that will be an efficient solution, also, i dont wanna use other libraries, only those that are included in Code::Blocks. Thanks in advance.

PS: I know that i can do things like:
1
2
number = number / 10; //12345 
 == 1234
or number = number % 10 //12345 == 5 but i want to get other things than this ones.
It really depends what you are aiming to achieve.

1
2
3
    int x = 12345;
    int y = (x/100) % 100;
    cout << "x = " << x << "   y = " << y << '\n';

x = 12345   y = 23

Thanks it worked, meh, just for random things :)
Topic archived. No new replies allowed.