Respuesta :

Answer:

Functions

The piece of code that is used to perform the same operation at multiple places with different parameters.

Loops

The piece of code that is used to perform a task multiple times and continue until the loop ends.

Explanation

Both of these have different kind of circumstances to apply. For example.

  1. Function can perform a specific operation whenever we call. but when we use loop it will perform same task at multiple times at same place.
  2. Functions can be called at different places to perform operations multiple times but once loop called it cannot complete the operations until loop completed.
  3. Each time when we call the function we can change the values but in loop in iteration we cannot change the value of any variable until loop ends.

Answer: look below in explanation

Explanation:

For a function, it is needed when it needs to perform a task numerous times in different places at the same time with unique parameters while for a loop, it performs a task multiple times until the loop ends. For a function, mainly it is when we want to change the values and when we want to perform a specific operation whenever we call it. It can be also used to be called at different places to perform operations several times. In a loop, you can't complete the operations until loop finishes and values cannot be changed in loop.