The document is a Java program that performs basic arithmetic operations like addition, subtraction, multiplication, division and modulus on two integer variables. The program defines the variables, performs the operations and prints the results.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
17 views1 page
JEFF Comp. Prog. Ass
The document is a Java program that performs basic arithmetic operations like addition, subtraction, multiplication, division and modulus on two integer variables. The program defines the variables, performs the operations and prints the results.
public static void main(String[] args) { int x = 5; int y = 7; int add = x + y; int subtract = x - y; int multiply = x * y; double divide = x / y; int remainder = x % y; System.out.println("The sum of x and y is: " + add); System.out.println("The difference of x and y is: " + subtract); System.out.println("The product of x and y is: " + multiply); System.out.println("The result of x divided by y is: " + divide); System.out.println("The remainder of x divided by y is: " + remainder); } } The Result of the process. The sum of x and y is: 12 The difference of x and y is: -2 The product of x and y is: 35 The result of x divided by y is: 0.0 The remainder of x divided by y is: 5