Learn in your language
Skip to content
IGCSE · Cambridge (CIE) · 0478

Read input and display output

Use INPUT to receive a value and OUTPUT to show results, prompts and messages.

Cambridge IGCSE Computer Science 0478 · Programming · 2026–2028 Version 6 · 8.1
Exam scope and assessment notes

This sequence follows Cambridge IGCSE Computer Science 0478, 2026–2028 syllabus Version 6. It covers section 8.1 (Programming concepts) only. Pseudocode examples use the published Cambridge format; the separate 2029–2031 syllabus is not mapped here. Practice is original, self-checked and does not award an official Cambridge grade. Full timed papers, a browser-based programming workspace and human subject-teacher review remain outstanding.

Before you begin

  • Be comfortable following an ordered algorithm and tracing variable values. Each lesson introduces the Cambridge pseudocode form it uses.

Work on paper. Try each question before revealing help, and explain why your method works.

Quick readiness check

What does OUTPUT Score display?

What you will learn

  • Read a value into a variable
  • Display values and explanatory text
  • Place input, processing and output in a clear order

INPUT stores a response

INPUT VariableName reads a value into a previously declared variable. The identifier may also be an individual array element.

A prompt tells the user what to enter. Display it first, then read the response, so the input has a clear purpose.

OUTPUT can combine values

OUTPUT sends text or values to the user. One command can display several values separated by commas, for example OUTPUT "Score: ", Score.

Keep the order logical: prompt, input, processing, then result. The message should identify units where they matter.

Pause and explain

Which order best asks for and displays a temperature?

Put the idea to work

Worked example

Write pseudocode that asks for a learner's name and displays a greeting.

Show the worked solution
  1. Declare LearnerName as STRING.
  2. Display a prompt explaining what is needed.
  3. Read the response and include it in the output.

Answer DECLARE LearnerName : STRING; OUTPUT "Enter your name"; INPUT LearnerName; OUTPUT "Welcome, ", LearnerName.

Try a topic test

Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.

Test this topic →

From guided practice to a new situation

Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.

1 · Guided

Write the commands to ask for a city and then display "You chose" with the city name.

Give me a hint

Use a STRING variable and make the prompt appear before INPUT.

Compare my reasoning
  1. Declare City : STRING.
  2. Output a prompt and input City.
  3. Output explanatory text and City together.

OUTPUT "Enter a city"; INPUT City; OUTPUT "You chose ", City.

Look for these in your work

  • Prompt before input
  • Correct variable
  • Combined output
2 · Independent

A program reads a distance and calculates a time. Name one output improvement beyond displaying the raw number.

Give me a hint

Think about what a learner needs to interpret the result.

Compare my reasoning
  1. Include a label such as "Travel time".
  2. State the time unit.
  3. Display the calculated value after the calculation.

Display a label, value and suitable unit, such as "Travel time: ", Time, " hours".

Look for these in your work

  • Label included
  • Unit included
3 · Transfer

A learner sees "17" on screen after entering a mark. Improve the output so it communicates the result clearly.

Give me a hint

Add context to the value.

Compare my reasoning
  1. Identify that the value is a mark.
  2. Include the maximum if known.
  3. Output the contextual message after processing.

For example, OUTPUT "Your mark is ", Mark, " out of 20".

Look for these in your work

  • Result identified
  • Context supplied

Common mistakes

  • Displaying a variable before reading or assigning it
  • Using INPUT without telling the user what to enter
  • Omitting units or context from a numeric result
Recall without your notes

What can you explain now?

Which command receives a value from the user?

Compare with the explanation

INPUT

INPUT reads a value into a variable.

After trying it yourself, choose your next review. This is your self-assessment.

Your review choice appears on Today. Sign in to sync it across devices.

Make it stick

Why should a prompt usually appear before an INPUT command?

If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.

Keep learning Computer Science

Course scope and assessment

165 original lessons map the listed objectives across all 10 main topics in the 2026–2028 Version 6 syllabus, with worked explanations and guided, independent and transfer practice. This is mapped teaching coverage, not proof of full exam readiness. Three earlier starter lessons remain available but are not counted as syllabus-mapped teaching. Practical programming experience in an executable browser workspace, full timed-paper practice, human subject-teacher review and the separate 2029–2031 syllabus remain outstanding. Practice is self-checked and does not award an official Cambridge grade.

StudyForA · Learn with understanding

Original teaching content and links to official sources. Check your exam year and qualification before using a resource.