Pergunta de entrevista da empresa WD

Asked to code a for loop in Java