Reducing duplication of code is one of the advantages of using a loop structure.

Question 3 Reducing code duplication is one of the benefits of using a loop structure. Your answer: Yes Ο Νο Clear answer Previous Next

Answer 1

Hi ! The answer to your question is
Why because loops will be used to control statements and
execute repeated instructions according to the
diseases. So we don’t need to make the code so duplicated as we can
shorten the code
using loops.
The base of these loops will help the programmer reduce the
duplication of code in your program.
For example, you need to read 10 values ​​from the user, so what
You would go ? If you don’t know loops, you can declare 10 variables
and read 10 times.
The whole thing is you need to write user read value 10
time. This means 9 times the same code duplicated with different
When using the same single statement loop logic and reading
10 times too.
Therefore, loops are advantages of reducing duplicate code in
your program.
All my wishes

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *