Online Java Compiler
public class MyClass { public static void main(String args[]) { int x=10; int y=40; System.out.println("Sum of x+y = " + (x+y)); System.out.println("Subtraction of y-x = " + (y-x)); System.out.println("Multiplication of x*y = " + (x*y)); System.out.println("y divided by x = " + (y/x)); } }
Output Results
Sum of x+y = 50 Subtraction of y-x = 30 Multiplication of x*y = 400 y divided by x = 4