+ 1

Take 3 inputs,find the highest and if equal to any other (top 2). Errors

What im i doing wrong the logic seems alright. https://code.sololearn.com/cGU6uvrEpm9K/?ref=app

18th Mar 2019, 5:57 PM
Antony O. Onyango
Antony O. Onyango - avatar
1 Odpowiedź
+ 5
https://code.sololearn.com/c452f7wnA6Nr/?ref=app The logic is just slightly off so let me just briefly go over the main parts. You started well checking if d1 (donation1) is more than d2 but then inside the if statement you checked if d2 is more than d3, even though you just established that d2 is not the one of the two highest numbers. Also you should use an "else if" statement next even though d1-is not more than d2 that doesn't necessarily mean it isn't equal to it. And lastly I just add an else statement in the event that all 3 donations are equal.
18th Mar 2019, 6:46 PM
LynTon
LynTon - avatar