Write a program to obtain a number N
and increment its value by 1 if the number is divisible by 4 otherwise decrement its value by 1.
#include <iostream>
using namespace std;
int main()
{
int N;
cin >> N;
if (N % 4 == 0)
{
cout << N + 1;
}
else
cout << N - 1;
}
Click on the above button to download the code.