Ten is extremely popular and attractive number. Everyone wants to be a ten. Or at least as close to it as possible. Two numbers are standing around wondering which of them is cooler. Answer: whichever is closer to ten. Let's write these numbers a displayClosestToTen method that will determine which of them is cooler.

# Closest to 10

- 4
Locked

absfor 10 - a; getabsfor 10 - b; then using if statements i determine which value is closes to 10 (smaller number would be closes) when i run the program i get the expected output of 7 and 11. However, i still get an error on validations. "Be sure that the program works correctly with numbers that are equally close to 10" Any thoughts?abs(int a)can be used to return absolute number. First substract the given numbers from ten and store them in a new variable (c and d for example).The result can also be a negative number. Use the if() statement to return a number for the giving conditions and don't forget to put the number inside the method so it's always positive. Good luck! Hint: if(abs(c) < abs(d) )...