Find absolute value of any number

the absolute value (or modulus) |x|of a real number x is the non-negative value of xwithout regard to its sign.
If number is less than zero return -(number) otherwise return number
public class OwnAbsoluteFunction {
     static int getAbsolute(int i){
     public static void main(String[] args) {
          int i=-10;


Leave a Reply

Your email address will not be published. Required fields are marked *

− 2 = 1