The main benefit of moving duplicated code into a function is:

  1. functions cannot have errors
  2. global variables are removed
  3. code is written once and reused, making it shorter and easier to fix
  4. 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