 The third step in developing an event-driven program is to write the main loop.This is a function that checks for the occurrence of events, and then calls the matching event handler to process it.Most event-driven programming environments already provide this main loop, so it need not be specifically provided by the application programmer.