Computing the remainder and its triple

Report a typo

Given an integer input, write a Java program that computes the following: divide the number by 2 and display the remainder, then multiply the result by 3 and display the result. The input will be a single integer 'n' (0 ≤ n ≤ 100). Print two lines where the first line shows the remainder of the number divided by 2 and the second line shows the result of the remainder multiplied by 3.

Sample Input 1:

10

Sample Output 1:

0
0

Sample Input 2:

7

Sample Output 2:

1
3
Write a program in Java 17
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int input = scanner.nextInt();

// The first operation goes here
// The second operation goes here

scanner.close();
}
}
___

Create a free account to access the full topic