What are some examples of why you'd use a loop?


#1

Question

What are some examples of why you’d use a loop?

Answer

Think of any task that is repetitive, you can likely make a loop for it. Some examples can be looping through an array of numbers to get the sum of the numbers, or looping through students’ grades to find who has the highest quiz scores, etc.