Java Operators my creations

0 15
Avatar for Anne10
Written by
3 years ago

public class Cribeproj {

public static void main(String[] args) {

int x = 13;

int y = 9;

double result = 0;

System.out.println("Variable values:");

System.out.println("x = " + x);

System.out.println("y = " + y);

System.out.println("result = " + result);

System.out.println(); //add a new line

System.out.println("Arithmetic Operation:");

result = x + y; //performs addition

System.out.println("Addition: x + y = " + result);

result = x - y; //performs subtraction

System.out.println("Subtraction: x - y = " + result);

result = x * y; //performs multiplication

System.out.println("Multiplication: x * y = " + result);

result = x / y; //performs division

System.out.println("Division: x / y = " + result);

result = x % y; //gets the remainder

System.out.println("Modulus: x % y = " + result);

}

}

1
$ 0.04
$ 0.04 from @TheRandomRewarder

Comments