Structured programming and subroutines (procedures and functions)
x

Why subroutines matter

Why subroutines matter

Main program calling a procedure and a function, with parameters going in, a return value coming back, and a local variable inside the function

Structured programming starts with sequence, selection and iteration, but large programs quickly become hard to read if every step is written in one long block. A subroutine solves this by putting a named task in its own block of code and running it only when it is called.

Structured programming and subroutines (procedures and functions) Lesson

  1. GCSE
  2. /Computer Science
  3. /Structured programming and subroutines (procedures and functions)