title: Write One Line C Function To Find Whether A No Is Power Of Two
signature: def writeOneLineCFunctionToFindWhetherANoIsPowerOfTwo(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Boolean , expected: Boolean): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, expected: Boolean): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        1, 
        true    
      )}")   
  
  
      println(s"TEST-1...${driver(
        2, 
        true    
      )}")   
  
  
      println(s"TEST-2...${driver(
        8, 
        true    
      )}")   
  
  
      println(s"TEST-3...${driver(
        1024, 
        true    
      )}")   
  
  
      println(s"TEST-4...${driver(
        24, 
        false    
      )}")   
  
  
      println(s"TEST-5...${driver(
        7, 
        false    
      )}")   
  
  
      println(s"TEST-6...${driver(
        46, 
        false    
      )}")   
  
  
      println(s"TEST-7...${driver(
        61, 
        false    
      )}")   
  
  
      println(s"TEST-8...${driver(
        73, 
        false    
      )}")   
  
  
      println(s"TEST-9...${driver(
        66, 
        false    
      )}")   
  
  }
  
source_py: def write_one_line_c_function_to_find_whether_a_no_is_power_of_two(n):
      if (n == 0):
          return False
      while (n != 1):
          if ((n % 2) != 0):
              return False
          n = (n // 2)
      return True
source_cpp: bool write_one_line_c_function_to_find_whether_a_no_is_power_of_two(int n) {
    if ( n == 0 ) return 0;
    while ( n != 1 ) {
      if ( n % 2 != 0 ) return 0;
      n = n / 2;
    }
    return 1;
  }