Question : finding absolute value in java
Answered by : grumpy-goose-hs0t3grb55ib
import java.lang.Math;
int sum,x=-5;
sum = Math.abs(x);
Source : | Last Update : Fri, 21 Aug 20
Question : absolute java
Answered by : selfish-swan-anh9wapi0ccq
public class Test { public static void main(String args[]) { Integer a = -8; double d = -100; float f = -90; System.out.println(Math.abs(a)); System.out.println(Math.abs(d)); System.out.println(Math.abs(f)); }
}
Source : https://www.tutorialspoint.com/java/number_abs.htm | Last Update : Sun, 08 Mar 20