Today lets learn about another loop control statement i.e., for loop. For loop is used to repeatedly execute certain set…