Wait, is this a console (text) program or a Windows (GUI) program?
In either case, you will have to add "event listeners": code that checks for input from the keyboard and the mouse. If a button is pressed, add the appropriate digit into the current number or invoke the appropriate function. If a key is pressed, add the appropriate digit into the current number or invoke the appropriate function.
In a Win32 console program, you'll have to either use the Curses library or use GetConsoleInput after using SetConsoleMode to add mouse events to the input mask.
In a Win32 GUI program, you'll add OnClick and OnKeyDown events to your application, or if you are writing your own WindowProc, listen for WM_LBUTTONDOWN and WM_KEYDOWN messages.
This is all for Win32, you may have noticed. If you are using Linux or DOS let me know.
Good luck.