title: K Th Digit Raised Power B
signature: function kThDigitRaisedPowerB($a, $b, $k) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return abs($actual - $expected) < 1e-09;
  }
  
  function driver($a, $b, $k, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($a, $b, $k), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        11, 2, 1, 
        1.0));
      
      printf("TEST-1...%s\n",driver(
        41, 3, 3, 
        9.210000000000036));
      
      printf("TEST-2...%s\n",driver(
        5, 4, 3, 
        6.25));
      
      printf("TEST-3...%s\n",driver(
        1, 2, 4, 
        0.001));
      
      printf("TEST-4...%s\n",driver(
        5, 2, 3, 
        0.25));
      
      printf("TEST-5...%s\n",driver(
        66, 5, 8, 
        5.233257599999973));
      
      printf("TEST-6...%s\n",driver(
        7, 10, 3, 
        2.489999999757856));
      
      printf("TEST-7...%s\n",driver(
        77, 30, 10, 
        4.0));
      
      printf("TEST-8...%s\n",driver(
        60, 50, 1, 
        0.0));
      
  }
  
  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;
  }