The main benefit of moving duplicated code into a function is:
- functions cannot have errors
- global variables are removed
- code is written once and reused, making it shorter and easier to fix
- the program runs without RAM
Answer
C) code is written once and reused, making it shorter and easier to fix
DRY – Don't Repeat Yourself; one fix updates every use. SLO CS-11-C-06
Computer Science MCQ · More Unit 3: Programming Fundamentals MCQs · Practise