Wednesday, 21 January 2015

Find absolute value of any number

the absolute value (or modulus) |x| of a real number x is the non-negative value of x without 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;


No comments:

Post a Comment