Passing primitive types in practice

Report a typo

Pass the input variable to the multiply message and print the message to show your result. Your message should have the following structure:

The input is input. The result of the multiplication is multiply(input).

Example:
If an input is 10, then the message is The input is 10. The result of the multiplication is 1000.

Sample Input 1:

2

Sample Output 1:

The input is 2. The result of the multiplication is 8.
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();

System.out.printf(/* Print the message here */);
}

public static int multiply(/* add a parameter here */) {
return (int) Math.pow(/* pass the parameter variable here */, 3);
}
}
___

Create a free account to access the full topic