title: Write One Line C Function To Find Whether A No Is Power Of Two
signature: write_one_line_c_function_to_find_whether_a_no_is_power_of_two <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          1L, 
          TRUE
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          2L, 
          TRUE
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          8L, 
          TRUE
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          1024L, 
          TRUE
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          24L, 
          FALSE
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          7L, 
          FALSE
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          46L, 
          FALSE
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          61L, 
          FALSE
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          73L, 
          FALSE
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          66L, 
          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;
  }