Professional Documents
Culture Documents
While Loop - SMSDSDSD
While Loop - SMSDSDSD
INDEFINIT
E LOOP The while loop repeats a set of statements for
an unspecified number of times until a given
condition (a statement that works out to be true
or false) is FALSE.
WHILE CONDITION DO
Statements to be repeated
Used to prompt for and
receive data to test the
condition. This is needed
OUTPUT STATEMENT again given that the similar
statements prior only execute
INPUT STATEMENT
once
ENDWHILE
BEGIN
DECLARE
Write a pseudocode algorithm to
accept a set of positive numbers,
terminated by 0. Calculate and print NUM SUM AS INTEGER
the sum of the numbers.
SUM 0
READ NUM
WHILE NUM DO
<> 0
READ NUM
ENDWHILE