For this Question: Given a number N, you have to perform only two types of operations on the number:-
1) If N is odd increase it by 1
2) If N is even divide it by 2

Your task is to find the number of operations it takes to make N equal to 1.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>MakeOne()</b> that takes integer N as argument.

Constraints:-
1 <= N <= 100000Return the number of operations it takes to make the number N equal to 1.Sample Input:-
7

Sample Output:-
4

Explanation:-
7 - > 8 - > 4 - > 2 - > 1

Sample Input:-
3

Sample Output:-
3, I have written this Solution Code: static int MakeOne(int N){
int cnt=0;
int a =N;
        while(a!=1){
            if(a%2==1){a++;}
            else{a/=2;}
            cnt++;
        }
return cnt;
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?