Task
Given a positive integer n
, output n+1
if n
is odd, and output n-1
if n
is even.
Input
A positive integer. You may assume that the integer is within the handling capability of the language.
Output
A positive integer, specified above.
Testcases
input output
1 2
2 1
3 4
4 3
5 6
6 5
7 8
8 7
313 314
314 313
Scoring
This is code-golf, so shortest answer in bytes wins.
Standard loopholes apply.