Untitled
unknown
plain_text
25 days ago
815 B
2
Indexable
Never
public class ArithmeticOperations { public static void main(String[] args) { if (args.length!= 2) { System.err.println("Usage: java ArithmeticOperations <num1> <num2>"); System.exit(1); } int num1 = Integer.parseInt(args[0]); int num2 = Integer.parseInt(args[1]); int sum = num1 + num2; int difference = num1 - num2; int product = num1 * num2; int quotient = num1 / num2; int remainder = num1 % num2; System.out.println("Sum: " + sum); System.out.println("Difference: " + difference); System.out.println("Product: " + product); System.out.println("Quotient: " + quotient); System.out.println("Remainder: " + remainder); } }
Leave a Comment