What is wrong?

Guillermo Sanchez asked 1 year ago

I received 20% error

Question solved. Code removed.

This topic was solved and cannot recieve new replies.

  • Raphael replied 1 year ago

    Yes but if U == B the correct answer should be 0 not -1.

  • João Castilho replied 1 year ago

    Hi Guillermo, not always U > B. You need to test both possibilities.


    25 12

    Expected output:

  • Guillermo Sanchez replied 1 year ago

    In that case, it would be enough with "abs"? like...

            printf("%d\n",  abs(U - B) - 1);