Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
11 views5 pages

Pseudocode

The document provides pseudocode for two main tasks: calculating the total and average of 10 numbers using different looping structures (for, while, repeat) and finding the largest and smallest of 5 numbers using for and count loops. Each section outlines variable declarations, input methods, and the logic for calculations and comparisons. The pseudocode emphasizes structured programming techniques for basic numerical operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

Pseudocode

The document provides pseudocode for two main tasks: calculating the total and average of 10 numbers using different looping structures (for, while, repeat) and finding the largest and smallest of 5 numbers using for and count loops. Each section outlines variable declarations, input methods, and the logic for calculations and comparisons. The pseudocode emphasizes structured programming techniques for basic numerical operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Pseudocode

1. INPUT 10 NUMBERS AND OUTPUT


THEIR TOTAL AND AVERAGE
[FOR LOOP]
DECLARE Number,Total,Count : INTEGER
DECLARE Average : REAL
Total  0
FOR Count  1 to 10 DO
INPUT Number
Total  Total + Number
Average  Total/Count
OUTPUT “Required total is: “,Total
OUTPUT “Required average is: “,Average
[WHILE LOOP]
DECLARE Number,Total,Count : INTEGER
DECLARE Average : REAL
Count  0
Total  0
WHILE Count < 10 DO
INPUT Number
Total  Total + Number
Count  Count + 1
ENDWHILE
Average  Total/Count
OUTPUT “required total is: “,Total
OUTPUT “required average is: “,Average
[REPEAT LOOP]
DECLARE Number,Total,Count : INTEGER
DECLARE Average : REAL
Count  0
Total  0
REPEAT
INPUT Number
Count  Count + 1
Total < Total + Number
UNTIL Count > 10
Average  Total/Count
OUTPUT “required total is: “,Total
OUTPUT “required average is: “,Average
2. INPUT 5 NUMBER AND OUTPUT
LARGEST AND SMALLEST
[FOR LOOP]
DECLARE Number, Largest, Smallest: INTEGER
INPUT Number
Largest = Number
Smallest = Number
FOR Count  1 TO 4
INPUT Number
IF Number > largest
THEN
Largest = Number
OUTPUT “largest number is:”, Largest
ENDIF
IF Number < Smallest
THEN
Smallest = Number
OUTPUT “smallest number is:”,Smallest
ENDIF
NEXT Count
[COUNT LOOP]
DECLARE Number, Largest, Smallest, Count: INTEGER
Largest  0
Smallest  100
INPUT Number
Largest = Number
Smallest = Number

You might also like