
class Sep4 {

	public static void main(String[] args) {

		int x = 0;
		System.out.println(x);


		// We can perform +, -, *, /

		// floating point division requires one operands to be
		// a floating point value.

		double y = (2 + 3) / 2;  // integer division
		y = ((2 + 3) * 2) / 2.0;  	// floating point division


		// order of precedence
		// https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html 

		y = 2 * (3 / 2.0);

		// post increment and pre increment

		x = x + 1;  // incrementing x, storing back in x
		x++;		// equivalent to above

		x = 0;

		System.out.println("x start: " + x);
		System.out.println("x: " + (x++));
		System.out.println("x: " + x);

		System.out.println("x: " + (++x));	


		x = x - 1;
		x--;


		// pre
		x = x + 5;
		x+=5;

		x = x - 5;
		x-=5;

		x = x * 5;
		x*=5;

		x = x / 5;
		x/=5;

		x = 0;
		System.out.println("x: " + (x+=5));


		// modulus

		x = 7;
		int mod = x % 2;
		
		// Math class

		double length = 25.0;
		double result = Math.sqrt(length);
		
		System.out.println("result: " + result);
		

	}
}
