LMC Iteration Structures: While/Endwhile Loop

GCSE Computer Science Resources
14-16 Years Old

48 modules covering every Computer Science topic needed for GCSE level, and each module contains:

  • An editable PowerPoint lesson presentation
  • Editable revision handouts
  • A glossary which covers the key terminologies of the module
  • Topic mindmaps for visualising the key concepts
  • Printable flashcards to help students engage active recall and confidence-based repetition
  • A quiz with accompanying answer key to test knowledge and understanding of the module
View the GCSE Resources →

KS3 Computing Resources
11-14 Years Old

We’ve created 45 modules covering every Computer Science topic needed for KS3 level, and each module contains:

  • An editable PowerPoint lesson presentation
  • Editable revision handouts
  • A glossary which covers the key terminologies of the module
  • Topic mindmaps for visualising the key concepts
  • Printable flashcards to help students engage active recall and confidence-based repetition
  • A quiz with accompanying answer key to test knowledge and understanding of the module
View the KS3 Resources →

The following program will show the use of branch instructions to create a WHILE/ENDWHILE iteration (loop) structure in a program.

The WHILE/ENDWHILE iteration structure tests the condition at the beginning of a loop (in this program, the loop continues while value1 is not zero). This means that if this test result is false (value1 is zero) at the beginning of the loop then the instructions inside the loop are never carried out.

Running the program: when prompted, INPUT a number, if the number is 0 then the program just ends. If any other number is entered then the . . .

This content is restricted to subscribers