As the name suggests, a control statement is a statement which determines whether or not the other statements of a…