Increment, then decrement an integer

Report a typo

Write a program that reads an integer N and prints the result of incrementing N by 1 and then decrementing the result by 2.

Sample Input 1:

5

Sample Output 1:

4

Sample Input 2:

10

Sample Output 2:

9
Write a program in Kotlin
// import required to read input from stdin
import java.util.Scanner

fun main() {
val scanner = Scanner(System.`in`)
// Read the input integer
val N = scanner.nextInt()

// TODO: Increment N by 1

// TODO: Decrement the result by 2

// Print the final result
println(N)
}
___

Create a free account to access the full topic