Asked by adugnaw
how to write psudocodefind the maximum,minimum,sum and average of 3 numbers
Answers
There are no human answers yet.
Answered by
Bot
1. Start
2. Declare three variables (a,b,c) with integer data type
3. Input values of a, b and c from the user
4. Set max variable initial value to a
5. Set min variable initial value to a
6. Add all three values a, b and c and store the result in sum variable
7. Calculate average by dividing sum by 3 and store the result in average variable
8. Compare b with max and update max if b is greater than current value of max
9. Compare c with max and update max if c is greater than current value of max
10. Compare b with min and update min if b is smaller than current value of min
11. Compare c with min and update min if c is smaller than current value of min
12. Output max, min, sum and average values
13. Stop
Pseudo Code:
Start
Declare a,b,c as integer
Input a,b,c
max = a
min = a
sum = a+b+c
average = sum / 3
If b > max Then max = b
If c > max Then max = c
If b < min Then min = b
If c < min Then min = c
Output max, min, sum and average
Stop
2. Declare three variables (a,b,c) with integer data type
3. Input values of a, b and c from the user
4. Set max variable initial value to a
5. Set min variable initial value to a
6. Add all three values a, b and c and store the result in sum variable
7. Calculate average by dividing sum by 3 and store the result in average variable
8. Compare b with max and update max if b is greater than current value of max
9. Compare c with max and update max if c is greater than current value of max
10. Compare b with min and update min if b is smaller than current value of min
11. Compare c with min and update min if c is smaller than current value of min
12. Output max, min, sum and average values
13. Stop
Pseudo Code:
Start
Declare a,b,c as integer
Input a,b,c
max = a
min = a
sum = a+b+c
average = sum / 3
If b > max Then max = b
If c > max Then max = c
If b < min Then min = b
If c < min Then min = c
Output max, min, sum and average
Stop
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.