title: K Th Digit Raised Power B
signature: function k_th_digit_raised_power_b(a, b, k)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return abs(actual - expected) < 1e-09
  end
  
  function driver(a, b, k, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(a, b, k), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(11, 2, 1, 1.0);
      @printf("TEST-0...%s\n",result);
      
      result = driver(41, 3, 3, 9.210000000000036);
      @printf("TEST-1...%s\n",result);
      
      result = driver(5, 4, 3, 6.25);
      @printf("TEST-2...%s\n",result);
      
      result = driver(1, 2, 4, 0.001);
      @printf("TEST-3...%s\n",result);
      
      result = driver(5, 2, 3, 0.25);
      @printf("TEST-4...%s\n",result);
      
      result = driver(66, 5, 8, 5.233257599999973);
      @printf("TEST-5...%s\n",result);
      
      result = driver(7, 10, 3, 2.489999999757856);
      @printf("TEST-6...%s\n",result);
      
      result = driver(77, 30, 10, 4.0);
      @printf("TEST-7...%s\n",result);
      
      result = driver(60, 50, 1, 0.0);
      @printf("TEST-8...%s\n",result);
      
  end
  
  main()
source_py: def k_th_digit_raised_power_b(a, b, k):
      p = (a ** b)
      count = 0
      while ((p > 0) and (count < k)):
          rem = (p % 10)
          count = (count + 1)
          if (count == k):
              return rem
          p = (p / 10)
source_cpp: int k_th_digit_raised_power_b(int a, int b, int k) {
    int p = pow ( a, b );
    int count = 0;
    while ( p > 0 && count < k ) {
      int rem = p % 10;
      count ++;
      if ( count == k ) return rem;
      p = p / 10;
    }
    return 0;
  }