For this Question: Anamika chooses a number N and they feel happy if the total number of set bits in N is equal to 1.
Decide whether Anamika is happy or sad.first line contains a single number N.Print "Happy" if Anamika is happy otherwise print "Sad".Sample Input 1:
4

Sample Output 1:
Happy


Sample Input 2:
7

Sample output 2:
Sad, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) {

                      Scanner sc=new Scanner(System.in);
                      int n = sc.nextInt();
                      int count = 0;
                      int temp = n;
                      while(n>0){
                          n = n & (n-1);
                          count++;
                      }
                      if(count==1){
                          System.out.println("Happy");
                      }
                      else{
                          System.out.println("Sad");
                      }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?