0% found this document useful (0 votes)
42 views4 pages

Pseudocode 3

Uploaded by

divaxo5320
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views4 pages

Pseudocode 3

Uploaded by

divaxo5320
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

DECLARE counter: Integer

FOR counter = 1 TO 10
OUTPUT counter

NEXT counter (increments the counter)


ENDFOR

DECLARE counter: Integer

counter = 1

WHILE counter <= 10


OUTPUT counter
counter = counter + 1

ENDWHILE

DECLARE counter: Integer


counter = 1

REPEAT
OUTPUT counter
counter = counter + 1
UNTIL counter > 10

DECLARE num, total, counter: Integer

counter = 1
WHILE counter <= 10
PRINT "Enter a number"
input num
total = total + num
counter = counter + 1
ENDWHILE

OUTPUT total

DECLARE num, total, counter: Integer

total = 0

FOR counter = 1 TO 10
PRINT "Enter a number"
input num
total = total + num

NEXT counter
ENDFOR

DECLARE num, counter, total: Integer

total = 0
REPEAT
PRINT "Enter a number: "
input num
total = total + num
counter = counter + 1
UNTIL counter > 10

DECLARE num, counter, total: Integer

total = 0

FOR counter = 1 to 50
Print "Enter a number"
input num
IF num > 100 THEN
total = total + 1

NEXT counter
ENDFOR

DECLARE num, counter, total: Integer

total = 0
counter = 0

WHILE counter <= 50


PRINT "Enter a number"
input num
IF num > 100 THEN
total = total + 1
counter = counter + 1
ENDWHILE

DECALRE num, counter, total: Integer

total = 0
counter = 0

REPEAT
PRINT "Enter a number: "
input num
IF num > 100 THEN
total = total + 1
counter = counter + 1
UNTIL counter > 50

DECLARE num, counter: Integer


DECLARE avg, total : Real

total = 0
avg = 0

FOR counter = 1 To 100


PRINT "Enter a number"
input num
total = total + num

NEXT counter
ENDFOR

avg = total / 100

OUTPUT avg

DECLARE num, counter: Integer


DECLARE total, avg: Real

avg = 0
total = 0

WHILE counter < 100


PRINT "Enter a number"
input num
total = total + num
counter = counter + 1
ENDWHILE

avg = total / 100

OUTPUT avg

DECLARE num, counter: Integer


DECLARE total, avg: Real

total = 0
counter = 0
avg = 0

REPEAT
Print "Enter a number"
input num
total = total + num
counter = counter + 1
UNTIL counter >= 100

avg = total / 100


OUTPUT avg

You might also like