package a;
import java.text.DecimalFormat;
public class bb {
public static void main(String[] args) {
public static void operation() {
int) (Math.random( ) * 4); int b = (int) (Math.random() * 100) ; . “+a + “+” + b + “=” + (a + b));
break; //Subtraction
System.out.println(” “);< ; System.out.println(" ");
System.out.println( i + “. “+a + “*” + b + “=” + (a * b));
break;
case 3:
if (b == 0) {// If b = 0 is calculated
I-;
Break;
} else {// If it is an integer output
If (a % b == 0) {
System.out.println (“”);
System.out.println (i + “.” + A + “/” + b + “=” + (a / b));
; System.out.println(” “);
.
String ss = new DecimalFormat(“0.00”).format(num);
String ss = new DecimalFormat(“0.00”). format(num); br>}
}
Break;
default: // All end
Break;
}
}
}
Running results
Java addition, subtraction, multiplication and division problems