0
How to run this code in one file
a. int n = 1; int m = -1; if (n < -m) { System.out.print(n); } else { System.out.print(m); } b. int n = 1; int m = -1; if (-n >= m) { System.out.print(n); } else { System.out.print(m); } c. double x = 0; double y = 1; if (Math.abs(x - y) < 1) { System.out.print(x); } else { System.out.print(y); } d. double x = Math.sqrt(2); double y = 2; if (x * x == y) { System.out.print(x); } else { System.out.print(y); } ====================================== I'm trying to run this code but it doesn't work Please let me know
6 Answers
0
You're declaring some variables multiple. The best solution would be to change their names. aNumber and bNumber e.g.
0
Could you write it for me? i donât fully understand
0
You have all the code, just put it into a file and rename the variables.
0
what if i don't want to change variables and use n,m and x,y ?
can I do it some how?