--Originally published at It's me
Honestly, this task was a little bit harder than I thought… Everything was great as usual until I had to validate that the numbers were lower and higher and that the numbers weren’t the same… But I did it! I think the code isn’t to good but it really worked and I’m glad.
Basically for the sum I just needed a loop with do while and for the counter variable instead of writing (cont= cont+1;) I just used the “trick” Ken gave us in class (cont++;). For the validates I used IF and ELSE, the order of this was the difficult part. Finally my code is:
And here it is, running with two same numbers, one bigger and one smaller in disorder and in order:
That’s all! Have a nice day.
Original gif at the begginig (because of my confusion) recovered from: http://giphy.com/gifs/gngO1gmBhS9na