Join 100,427 users already on read.cash

Java Operators my creations

0 6 exc
Avatar for Anne10
Written by   30
2 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
Enjoyed this article?  Earn Bitcoin Cash by sharing it! Explain
...and you will also help the author collect more tips.

Comments