title: Write One Line C Function To Find Whether A No Is Power Of Two
signature: writeOneLineCFunctionToFindWhetherANoIsPowerOfTwo(n) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(bool actual, bool expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(n, bool expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          1, 
          true)
      }");
  
      print("TEST-1...${driver(
          2, 
          true)
      }");
  
      print("TEST-2...${driver(
          8, 
          true)
      }");
  
      print("TEST-3...${driver(
          1024, 
          true)
      }");
  
      print("TEST-4...${driver(
          24, 
          false)
      }");
  
      print("TEST-5...${driver(
          7, 
          false)
      }");
  
      print("TEST-6...${driver(
          46, 
          false)
      }");
  
      print("TEST-7...${driver(
          61, 
          false)
      }");
  
      print("TEST-8...${driver(
          73, 
          false)
      }");
  
      print("TEST-9...${driver(
          66, 
          false)
      }");
  
      return 0;
  }
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;
  }