The operating system controls computer system resources and coordinates the flow of data to end from the micro processor. At the same time it also controls the flow of data between input and output devices such as keyboard & monitor.
Multiprogramming operating system allows more than one program to run concurrently. In a given moment, only one task is actually being executed but within a larger time span of several minutes, the computer is processing several programs by alternating between actual executions. When one job needs to do I/O, another can resume. So two or more independent programs are executed in the same time span by inter leaving their execution.