All the Operators
Completed
Read two positive integers a and b and print a+b, a-b, a*b, a/b, a%b one per line.
Input
Two integers.
Output
Five lines.
Example
Input
17 5
Output
22 12 85 3 2
Editor
Java
Hints
/ between two ints is integer division.
Solution explanation
% gives the remainder of the division.
Show solution
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(a + b);
System.out.println(a - b);
System.out.println(a * b);
System.out.println(a / b);
System.out.println(a % b);
}
}