Test your knowledge with free interactive questions on Seneca — used by over 10 million students.

Subroutines

A subroutine is a named block of code within your program.

Advantages of subroutines

Advantages of subroutines

  • Easier to read:
    • There are fewer long blocks of code to understand.
  • More efficient:
    • Blocks of code can be written once and reused many times.
  • More reliable:
    • Each subroutine can be individually tested to make sure it works.
Parameters and arguments

Parameters and arguments

  • Parameters are special variables used to pass values into a subroutine.
  • Arguments are the actual values that are passed in.
Types of subroutine

Types of subroutine

  • A function is a subroutine which returns a value.
  • A procedure is a subroutine which does not return a value.
Jump to other topics
1

Computational Thinking & Algorithms

2

Programming

3

Hardware & Software

4

Data

5

The Internet

6

Online Safety & Security

Practice questions on Subroutines

Can you answer these? Test yourself with free interactive practice on Seneca — used by over 10 million students.

  1. 1
  2. 2
Answer all questions on Subroutines

Unlock your full potential with Seneca Premium

  • Unlimited access to 10,000+ open-ended exam questions

  • Mini-mock exams based on your study history

  • Unlock 800+ premium courses & e-books

Get started with Seneca Premium