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 += 1

else:

A -=2

print(A)

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 += 1

else:

A -=2

print(A)

- Details
- Written by Rahmatjon Hakimov
- Category: If
- Hits: 161