+ 4

[TRY TO SOLVE WITH EFFICIENT ALGORITHM WITH RESPECT TO FASTNESS OF EXECUTION]

we know pythagerous theorem,input will be taken as n.then output will be the side1,side2 and hypotenuse up to given possible number. sample output if n=4... side1=1. not possible side1=2. not possible side1=3. side2=4. hypotenuse=5 side1=4. side 2=3. hypotenuse=5

6th Feb 2018, 2:51 PM
SAKSHI
SAKSHI - avatar
12 ответов
6th Feb 2018, 4:34 PM
LukArToDo
LukArToDo - avatar
+ 5
please explain properly ps : @Louis I have same questions
6th Feb 2018, 4:49 PM
code learner
code learner - avatar
+ 5
I need a bit more explanation????
6th Feb 2018, 5:02 PM
Saurabh Tiwari
Saurabh Tiwari - avatar
+ 5
why side 1=4 is not possible in that case we will have side2=3 and hypo 5
6th Feb 2018, 8:25 PM
Saurabh Tiwari
Saurabh Tiwari - avatar
+ 4
Can the input (n) be any of the sides or the hypotenuse? Must the values of sides and hypotenuse always be an integer?
6th Feb 2018, 3:49 PM
Louis
Louis - avatar
+ 3
@Saurabh Tiwari..can I know exactly what you didn't understood?
6th Feb 2018, 6:44 PM
SAKSHI
SAKSHI - avatar
+ 3
@code learner.. please do ask...even I didn't many of our sololearn friends will do...
6th Feb 2018, 6:47 PM
SAKSHI
SAKSHI - avatar
+ 3
@SAKSHI please choose ONE of the following from each question. Question 1: n can be assigned to- a) side 1 b) side 2 c) the hypotenuse d) a OR b e) a OR b OR c Question 2: The following values are integer values, those not mentioned may be float. a) Side 1 b) Side 2 c) The hypotenuse d) a AND b e) a AND b AND c
6th Feb 2018, 7:15 PM
Louis
Louis - avatar
+ 3
@Louis n-> side 1 only integral values
7th Feb 2018, 1:04 AM
SAKSHI
SAKSHI - avatar
+ 3
@Saurabh Tiwari yeah you are correct.sry my mistake....thanks for finding
7th Feb 2018, 1:05 AM
SAKSHI
SAKSHI - avatar
+ 3
ok we've to find all pythagorean triplets upto that no.(user input)
7th Feb 2018, 4:21 AM
Saurabh Tiwari
Saurabh Tiwari - avatar
+ 2
@Louis i given in sample output that as side 1
6th Feb 2018, 6:42 PM
SAKSHI
SAKSHI - avatar