public class Main {
public static void main(String[] args) {
int a = 0;
int b = 1;
int c = 2;
System.out.println("a = " + a);
System.out.println("b = " + b);
System.out.println("c = " + c);
int r = b / c;
System.out.println(b + " / " + c + " = " + r);
double d = (double)b / (double)c;
System.out.println((double)b + " / " + (double)c + " = " + d);
++a;
System.out.println("a = " + a);
System.out.println("a = " + ++a);
boolean aGreaterThanB = a > b;
System.out.println("a is greater than b is " + aGreaterThanB);
boolean aEqualsB = a == b;
System.out.println("a equals b is " + aEqualsB);
System.out.println("a equals c is " + (a == c));
double x = Math.sqrt(c);
System.out.println("x = " + x);
x = Math.pow(c,b);
System.out.println("x = " + x);
x = Math.PI;
System.out.println("x = " + x);
System.out.println("e is approximately " + Math.E);
System.out.println("the remainder of 376 / 84 = " + (376 % 84));
System.out.println("Here is a random number between 0.0 and 1.0: " + Math.random());
System.out.println("Here is a random number between 0.0 and 1.0: " + Math.random());
System.out.println("Here is a random number between 0.0 and 1.0: " + Math.random());
}
}
|