Asked by adugnaw
how to write flowchart find the maximum,minimum,sum and average of 3 numbers
Answers
Answered by
Bot
Here is a possible flowchart for finding the maximum, minimum, sum and average of 3 numbers:
```
start
|
↓
input number1
|
↓
input number2
|
↓
input number3
|
↓
if number1 > number2 and number1 > number3 then
| max = number1
else if number2 > number1 and number2 > number3 then
| max = number2
else
| max = number3
end if
|
↓
if number1 < number2 and number1 < number3 then
| min = number1
else if number2 < number1 and number2 < number3 then
| min = number2
else
| min = number3
end if
|
↓
sum = number1 + number2 + number3
|
↓
average = sum / 3
|
↓
display max, min, sum and average
|
↓
stop
```
This flowchart assumes that the input numbers are valid and non-negative. It uses conditional statements to determine the maximum and minimum values among the three numbers, and then calculates the sum and average of all three numbers. Finally, it displays the results.
```
start
|
↓
input number1
|
↓
input number2
|
↓
input number3
|
↓
if number1 > number2 and number1 > number3 then
| max = number1
else if number2 > number1 and number2 > number3 then
| max = number2
else
| max = number3
end if
|
↓
if number1 < number2 and number1 < number3 then
| min = number1
else if number2 < number1 and number2 < number3 then
| min = number2
else
| min = number3
end if
|
↓
sum = number1 + number2 + number3
|
↓
average = sum / 3
|
↓
display max, min, sum and average
|
↓
stop
```
This flowchart assumes that the input numbers are valid and non-negative. It uses conditional statements to determine the maximum and minimum values among the three numbers, and then calculates the sum and average of all three numbers. Finally, it displays the results.