HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /A flowchart inputs two numbers, A and B…
EasyComputer ScienceHigh School (9–10)Computer Science › Algorithms and Problem-SolvingNumericalIGCSE

A flowchart inputs two numbers, A and B…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

A flowchart inputs two numbers, A and B. A decision asks A > B?. Yes leads to OUTPUT A. No leads to OUTPUT B. Both then go to STOP.

  1. What is output for A=4A = 4A=4 and B=9B = 9B=9?
  1. What is output for A=6A = 6A=6 and B=6B = 6B=6?
  1. State the purpose of the flowchart.

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

Flowchart symbols: terminator (START, STOP), process (rectangle), input/output (parallelogram), decision (diamond, two exits Yes and No), subroutine (rectangle with a line inside each end), flow line (arrow). A flow line back to an earlier shape makes a loop. Conditions are written precisely, such as Count > 10.

The worked solution

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Step 1. 4>94 > 94>9 is false, so the No path outputs B, which is 999.

Step 2. 6>66 > 66>6 is false, so the output is B, which is 666. Both numbers are 666, so the output is still right.

Step 3. Purpose. It inputs two numbers and outputs the larger one. If they are equal it outputs that value.

Answer: (a) 999, (b) 666.

The pseudocode is:

pseudocode
INPUT A
INPUT B
IF A > B
  THEN
    OUTPUT A
  ELSE
    OUTPUT B
ENDIF
Log in to save this for later
← All Problems
← A door lock asks for a password until the right one, Open, is typed…This is the kind of long scenario question that ends Paper 2… →
More onComputer Science › Algorithms and Problem-Solving

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. FlowchartsPlanning a Program: Life Cycle, Decomposition and Flowcharts

More on this topic

  1. This is the kind of long scenario question that ends Paper 2…Hard
  2. A delivery company adds a check digit to each parcel number…Medium
  3. Name the check in each case. Say whether it is validation or verification…Easy
A bubble sort is changed so that it sorts in descending order: the comparison becomes IF…Hard
  • A shop stores the colours of the ten bicycles in its window in an array Colours: red, blue, red…Medium
  • All problems on this topic →