what is in the task ??
package com.codegym.task.task04.task0409;
/*
Closest to 10
*/
public class Solution {
public static void main(String[] args) {
displayClosestToTen(8, 11);
displayClosestToTen(7, 14);
}
public static void displayClosestToTen(int a, int b) {
// write your code here
int c = abs(a) - 10;
int d = abs(b) - 10;
int s1 = abs(c);
int s2 = abs(d);
if (s1<s2)
System.out.println(a);
else if (s1>s2)
System.out.println(b);
else if (s1==s2)
System.out.println( a + b );// write your code here
}
public static int abs(int a) {
if (a < 0) {
return -a;
} else {
return a;
}
}
}