use of loop and array