title: Write One Line C Function To Find Whether A No Is Power Of Two
signature: function writeOneLineCFunctionToFindWhetherANoIsPowerOfTwo($n) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($n, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($n), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        1, 
        true));
      
      printf("TEST-1...%s\n",driver(
        2, 
        true));
      
      printf("TEST-2...%s\n",driver(
        8, 
        true));
      
      printf("TEST-3...%s\n",driver(
        1024, 
        true));
      
      printf("TEST-4...%s\n",driver(
        24, 
        false));
      
      printf("TEST-5...%s\n",driver(
        7, 
        false));
      
      printf("TEST-6...%s\n",driver(
        46, 
        false));
      
      printf("TEST-7...%s\n",driver(
        61, 
        false));
      
      printf("TEST-8...%s\n",driver(
        73, 
        false));
      
      printf("TEST-9...%s\n",driver(
        66, 
        false));
      
  }
  
  main();
  ?>
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;
  }