**New course!**Every coder should learn

**Generative AI!**

+ 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

12 Answers

+ 5

please explain properly
ps : @Louis I have same questions

+ 5

I need a bit more explanation????

+ 5

why side 1=4 is not possible
in that case we will have side2=3 and hypo 5

+ 4

Can the input (n) be any of the sides or the hypotenuse?
Must the values of sides and hypotenuse always be an integer?

+ 3

@Saurabh Tiwari..can I know exactly what you didn't understood?

+ 3

@code learner.. please do ask...even I didn't many of our sololearn friends will do...

+ 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

+ 3

@Louis n-> side 1
only integral values

+ 3

@Saurabh Tiwari yeah you are correct.sry my mistake....thanks for finding

+ 3

ok
we've to find all pythagorean triplets upto that no.(user input)

+ 2

@Louis i given in sample output that as side 1