LMC Iteration Structures: While/Endwhile Loop

46 Computer Science Topics

We’ve created 46 modules covering every Computer Science topic needed for GCSE level. These are transferable across AQA, CIE, Edexcel, CIE & Internationally. Suitable for teachers or home educators alike.

Whether you’re a brand new Computer Science teacher, or you’ve been teaching ICT for years, our resources will save you hours and hours of lesson preparation every single week.

View the 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