title: Write One Line C Function To Find Whether A No Is Power Of Two
signature: pub fn write_one_line_c_function_to_find_whether_a_no_is_power_of_two(n: i32) -> bool {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: bool, expected: bool)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: bool)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        1, 
        true
      ));
      
      println!("TEST-1...{}", driver(
        2, 
        true
      ));
      
      println!("TEST-2...{}", driver(
        8, 
        true
      ));
      
      println!("TEST-3...{}", driver(
        1024, 
        true
      ));
      
      println!("TEST-4...{}", driver(
        24, 
        false
      ));
      
      println!("TEST-5...{}", driver(
        7, 
        false
      ));
      
      println!("TEST-6...{}", driver(
        46, 
        false
      ));
      
      println!("TEST-7...{}", driver(
        61, 
        false
      ));
      
      println!("TEST-8...{}", driver(
        73, 
        false
      ));
      
      println!("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;
  }