Program to print the series 2, 1, 4, 3, 6, 5, .... up to N terms
Given a number N, the task is to print the below pattern upto N terms: 2, 1, 4, 3, 6, 5, .... N terms Examples: Input: N = 4 Output: 2, 1, 4, 3 Explanation: Nth Term = (N % 2 == 0) ? (N - 1) : (N + 1) 1st term = (1 % 2 == 0) ? (1 - 1) : (1 + 1) = (1 + 1) = 2 2nd term = (2 % 2 == 0) ? (2 - 1) : (2 +