In: Computer Science
Draw a flowchart and pseudocode that accepts three numbers from a user and displays a message if the sum of any two numbers equals the third.
Make a working version of this program in Python.
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
Flow chart :
Demonstration :
Here a new python program with name "main.py" is created, which contains following code.
main.py :
#asking user to enter number1
number1=int(input("Enter first number:"))
#asking second number
number2=int(input("Enter second number:"))
#asking third number
number3=int(input("Enter third number:"))
#checking sum of any two number with third one
if((number1+number2)==number3):
#if sum of number1 and number2 are equal to number3 then
print("sum of "+str(number1)+" and "+str(number2)+" are equal to
"+str(number3))
elif((number2+number3)==number1):
#if sum of number3 and number2 are equal to number1 then
print("sum of "+str(number2)+" and "+str(number3)+" are equal to
"+str(number1))
elif((number1+number3)==number2):
#if sum of number1 and number3 are equal to number2 then
print("sum of "+str(number1)+" and "+str(number3)+" are equal to
"+str(number2))
else:
print("sum of any two numbers are not equal to third
one")
======================================================
Output : Compile and Run main.py to get the screen as shown below
Screen 1 :main.py, screen when sum of any two number is not equal to third one
Screen 1 :main.py, screen when sum of any two number is equal to third one
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.