For this Question: Chef is playing with a number N. If the total number of set bits in N is even then Chef is happy. Determine whether Chef is happy or not.first line contain a single integer N.if the total number of set bits in N is even print "Yes" otherwise print "No"Sample Input 1:
7

Sample Output 1:
NO

Sample Input 2:
24

Sample Output 1:
Yes, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
int num_of_set_bit(int n){
 int ans=0;
 while(n)ans+=n%2, n/=2;
 return ans;
}
int main()
{
 int N;
 cin>>N;
 int x=num_of_set_bit(N);
 cout<<((x&1)? "No":"Yes");
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?