A computer program is a set of statements that is used to create an output, such as a screen display, a printed report, a set of data records, or a calculated set of numbers. Most programs involve statements that are executed in sequence. A program is written using the statements of a programming language. Individual statements perform simple operations such as printing an item of text…