 To add two numbers, storage outside the event handler must be used.The implementation might look like below.globally declare the counter K and the integer T.
OnKeyEnter(character C)

While keeping track of history is normally trivial in a sequential program because event handlers execute in response to external events, correctly structuring the handlers to work correctly when called in any order can require special attention and planning in an event-driven program.