User Rating: 0 / 5

If02. Given an integer. If it is positive, then add 1; Otherwise subtract from it 2. Output the resulting number.

Solution in Python 3:

A = int(input("Enter the number: "))if A > 0:    A += 1else:    A -=2print(A)