For this Question: Sara is learning bits manipulation today and she is stuck on a problem and asks for your help.
Problem:-
Given an integer N. Your task is to change the integer to 0 by performing the following operations:-
1. Change the rightmost digit(0th index). i. e you can change the rightmost digit to 1 if it is 0 or 0 if it is 1.
2. Change the ith bit if (i-1)th bit is 1 and all bits right to (i-1) is 0. For eg:- you can change the left most bit of these numbers:- 1100, 110, 110000.

Your task is to find the minimum operation to make the number 0.The input contains a single integer N.

Constraints:-
0 <= N <= 1000000000Print the minimum number of operations requiredSample Input:-
3

Sample Output:-
2

Explanation:-
3- >11(binary representation)
01;- Change the leftmost bit using the second operation
00:- Change the rightmost bit using the first operation

Sample Input:-
14

Sample Output:-
11

Explanation:-
14 - > 1110
1111 - > using 1st operation
1101 - > using 2nd operation
1100 - > using 1st operation
0100 - > using 2nd operation
0101 - > using 1st operation
0111 - > using 2nd operation
0110 - > using 1st operation
0010 - > using 2nd operation
0011 - > using 1st operation
0001 - > using 2nd operation
0000 - > using 1st operation, I have written this Solution Code: 
#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795
#define max1 101
#define MOD 1000000007

#define read(type) readInt<type>()

#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);

}

int solve(int n){
if(n==1){
    return 1;
}
if(n==0){
    return 0;
}
int ans=1;
int cnt=0;
while(ans<n){
    ans*=2;
    cnt++;
}
ans/=2;

ans+=ans/2;
return solve(ans^n)+pow(2,cnt-1);

}
signed main(){
    int n;
    cin>>n;
    cout<<solve(n);
}


, In this Programming Language: C++, Now tell me if this Code is compilable or not?