You are on page 1of 2

1.

Write a pseudocode algorithm to read a sequence of numbers terminated by 999 and


print their total

SAMPLE DATA: 9, 6, 20, 10, 999

Pseudocode

START
DECLARE num,Total AS INTEGER

Total 0
READ num

WHILE num <> 999 DO

Total Total + num


READ num

ENDWHILE

PRINT Total

STOP

Flowchart

Tracetable

num Total Output


9 0 *
6 9 *
20 15 *
10 35 *
999 45 45

2. Write a pseudocode algorithm to read 25 numbers and find their sum and average. Print
sum and average
3. Write a pseudocode algorithm to read a sequence of numbers terminated by 999. The
pseudocode should count and print the number of negative values and zero values. The
algorithm should also print sum of positive numbers.
4. Write a pseudocode algorithm to read 100 numbers and find their sum.
5. Write a pseudocode algorithm to read a sequence of numbers terminated by 0 and
print their sum

You might also like