Keypad

You just need to keep track of the number you are creating from the input. Every time you get a new input, multiply this by ten and add the new input to it. It's hard to create a solid example without more specifics, but something like the following should work:

int number = 0;

while( <more_input_required> )
{
  number *= 10;
  number += get_input();
}

Of course, you'll need to replace <more_input_required> with your own condition (no. of digits expected etc.) and replace get_input() with whatever function you call to get the next input.