Program Output
Print default values of variables
iA = 2
fB = 2.0
dC = 3.141592
Print formatted variable
dC = 3.14
Print booleans ..
boolean aTest = true
boolean bTest = false
Print range of integers ..
Maximum integer = 2147483647
Ninimum integer = -2147483648
Print range of floating point nos ..
Maximum float = 3.4028235E38
Minimum float = 1.4E-45
Maximum double = 1.7976931348623157E308
Minimum double = 4.9E-324
Basic arithmetic expressions ..
Addition: 2 + 3 = 5
Subtraction: 2 - 3 = -1
Multiplication: 2 + 3*5 = 17
Use of the modulo operator ..
Remainder : 10%3 = 1
Remainder : 11%3 = 2
Remainder : 12%3 = 0
Remainder : 13%3 = 1
Division of integers in Java ..
Integer division: 1/3 = 0
Integer division: 2/3 = 0
Integer division: 3/3 = 1
Integer division: 4/3 = 1
Integer division: 5/3 = 1
Division of floating point numbers ...
Division: 1/3. = 0.3333333333333333
Division: 2./3 = 0.6666666666666666
Division: 3./3 = 1.0
Division: 4/3. = 1.3333333333333333
Division: 5./3 = 1.6666666666666667
Relational expressions : iB = 1; iC = 2
Test: iB > iC = false
Test: iC > iB = true
Test: iC == iB = false
Test: iC != iB = true
Exercise math constants ..
Math: e = 2.718281828459045
Math: pi = 3.141592653589793
Exercise math functions ..
Math: sin(pi) = 1.2246467991473532E-16
Math: cos(pi) = -1.0
Math: square root 2 = 1.4142135623730951
Math: 2^3 = 8.0
Math: e^(pi) = 23.140692632779263
Exercise max and min functions ..
Math: min(2,3) = 2
Math: max(2,3) = 3
Math: max( max(-4, 3), -3) = 3
Exercise round and floor functions ..
Math: abs (pi) = 3.141592653589793
Math: abs (-pi) = 3.141592653589793
Math: round (pi) = 3
Math: round (5*pi) = 16
Math: floor (pi) = 3.0
Math: floor (-pi) = -4.0