logo

Cambridge IGCSE Computer Science practice

What is the main purpose of a function in programming?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

cambridge_mcq

Style

Topic

P rogramming concepts

Exam-style question

Try this first

What is the main purpose of a function in programming?.

  1. A.To perform a task without returning a value
  2. B.To perform a task and return a value
  3. C.To store data temporarily
  4. D.To define a variable

Answer and explanation

Concise answer

To perform a task and return a value

Why this is correct

Functions are designed to execute a specific task and provide a result back to the caller.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

Flashcard 1 of 6

Press Space to flip, arrows to move

Related practice questions