Arithmetic expression

Report a typo

Write a program that reads an integer value n from the standard input and outputs the result of the following arithmetic expression:

((n + 1) * n + 2) * n + 3

Sample Input 1:

3

Sample Output 1:

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

class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// put your code here
}
}
___

Create a free account to access the full topic