0

Guys please please tell me , in this code if I enter 10,20,5 respectively the output is wrong ,please correct me

Please help https://code.sololearn.com/WfY23FAEi066/?ref=app

15th May 2021, 11:55 AM
roshan roy
6 Respostas
0
Hi! make a fourth variable, and assign it the value of any variable at the beginning of the code, for example, largest = x, then just compare this variable with the two remaining y, z alternately, and if it turns out that y or z is greater, assign this value to largest.
15th May 2021, 12:06 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Bro what about this code
15th May 2021, 12:07 PM
roshan roy
0
But when I enter 10,20,5 it outputs wrong
15th May 2021, 12:10 PM
roshan roy
0
if you want to fix this code, then use less complex constructs, and for example, in one comparison, use the operators AND OR ( && ||)
15th May 2021, 12:10 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Bro but this is correct is correct is,nt it
15th May 2021, 12:12 PM
roshan roy
0
try to find the error yourself: Visualize your code execution (Python, Java, C, C++, JavaScript, Ruby) https://pythontutor.com
15th May 2021, 12:29 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar