Need a help.... please? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Need a help.... please?

My question is to find high and low value. high value is printing properly but low value not it giving 0 0 anyone can fix please https://code.sololearn.com/caKQPDt8YC9m/?ref=app

17th May 2020, 9:39 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
5 Answers
+ 1
Aniket Soni the problem starts after you printed the first and second top marks . You are making the if statement useless by comparing l1 and l2 having known both values are already zero . As a result , No if statement gets a true value in your loop and result remains 0 as values of l1 and l2 are not altered .
18th May 2020, 1:07 PM
Hima
Hima - avatar
0
Your code gives a lot of error and warning messages.
17th May 2020, 9:52 AM
Denise Roßberg
Denise Roßberg - avatar
0
Its working in other compiler
17th May 2020, 9:53 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
Unfortunately I can only use the code playground. But I would create two loops: one for min value and one for max value. Then you don't have any troubles.
17th May 2020, 9:56 AM
Denise Roßberg
Denise Roßberg - avatar
1st Jun 2020, 9:19 AM
Gulab Patel
Gulab Patel - avatar