Following code return the scan code of the key hit
Code: CPP
include <dos.h>
getkey()
{
    union REGS i, o;
    while(!kbhit());
    i.h.ah = 0;
    int86(22,&i,&o);
    return o.h.ah;
}
Now the code can help you to get the Scan code of the required number and then grphics programming can help you draw the object.