Untitled
unknown
plain_text
a year ago
586 B
5
Indexable
public class Calculator {
public static void main(String[] args){
int x = Integer.parseInt(args[0]);
int y = Integer.parseInt(args[1]);
// Sum
int sum = x + y;
// Difference
int diff = x - y;
// Product
int product = x*y;
// Quotient
int quot = x/y;
// Remainder
int remai = x%y;
System.out.printf("The Result of operations on %d and %d are:\nSum = %d\nDifference = %d\nProduct = %d\nQuotient = %d\nRemaider = %d", x, y, sum, diff, product, quot, remai);
}
}Editor is loading...
Leave a Comment