Question: # ##Problem 2: # User provides as input 3 numbers. # These numbers should be kept inside variables named p. q and r. # Output
# ##Problem 2: # User provides as input 3 numbers. # These numbers should be kept inside variables named p. q and r. # Output if the 3 numbers can form a triangle or not. # Three numbers can form a triangle if the sum of any two is greater than the third. # For example, 3, 4, and 5 can form a triangle since # 3+4 > 5 and 3+5 > 4 and 4+5 > 3 # # For example, 1, 2, and 3 cannot form a triangle since #1 + 3 > 2 and 2 + 3 > 1 HOWEVER 1 + 2 is not greater than 3 # # Your final output should be either # Can form a triangle #or # Cannot form a triangle # Write your code below
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
