Use arithmetic, relational and logical operators
Build expressions with the Cambridge operators and check their type and order of evaluation.
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 type of result does Score >= 50 produce?
What you will learn
- Use arithmetic operators including DIV and MOD
- Compare values with relational operators
- Combine Boolean conditions with AND, OR and NOT
Arithmetic expressions calculate values
Use +, −, *, / and ^ for arithmetic. DIV returns the whole-number quotient and MOD returns the remainder for integer operands; for example DIV(17,5)=3 and MOD(17,5)=2.
Multiplication and division have precedence over addition and subtraction. Use parentheses in a complex expression to make the intended order clear.
Relational and logical expressions return BOOLEAN
The syllabus relational operators are =, <, <=, >, >= and <>. Each comparison produces TRUE or FALSE.
Combine Boolean conditions with AND, OR and NOT. Parentheses make a long condition easier to read, for example (Age >= 13) AND (Age <= 18).
Pause and explain
A pass requires Mark >= 50 and CourseworkComplete = TRUE. Which operator joins the conditions?
Worked example
A learner is eligible when their score is at least 60 and they submitted the task. Write the condition.
Show the worked solution
- Compare Score with the inclusive threshold 60.
- Use a Boolean variable such as Submitted.
- Both conditions must be true, so combine them with AND.
Answer Eligible ← (Score >= 60) AND Submitted.
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.
For 23 sweets shared among 5 learners, calculate the whole number per learner and the remainder.
Give me a hint
Use DIV for the quotient and MOD for the remainder.
Compare my reasoning
- Calculate DIV(23,5).
- Calculate MOD(23,5).
- Check that 5 × quotient + remainder = 23.
Each learner gets 4; 3 remain.
Look for these in your work
- DIV result
- MOD result
- Check balances
Write a condition that is TRUE for temperatures from 18 through 25 inclusive.
Give me a hint
Both endpoints are allowed, so use >= and <=.
Compare my reasoning
- Compare Temperature >= 18.
- Compare Temperature <= 25.
- Combine with AND.
(Temperature >= 18) AND (Temperature <= 25).
Look for these in your work
- Inclusive comparisons
- AND used
A ticket is discounted if a learner is under 16 OR has a student pass. Write a condition and explain why OR fits.
Give me a hint
Either route qualifies.
Compare my reasoning
- Create the age condition Age < 16.
- Create the Boolean condition HasStudentPass = TRUE.
- Join them with OR because either may be sufficient.
Discounted ← (Age < 16) OR HasStudentPass.
Look for these in your work
- Both conditions included
- OR justified
Common mistakes
- Using / when an integer quotient is required
- Confusing MOD with DIV
- Using OR when both conditions must be true
- Omitting parentheses from a complex expression
What can you explain now?
What are DIV(17,5) and MOD(17,5)?
Compare with the explanation
3 and 2
Five fits into 17 three times with remainder 2.
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
What is the difference between DIV and MOD?
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.