# Problem Definition

## Description

Implement pow(x, n) % d.

In other words, given x, n and d,

find (x^n % d)

Note that remainders on division cannot be negative.
In other words, make sure the answer you return is non negative.

Input : x = 2, n = 3, d = 3
Output : 2

2^3 % 3 = 8 % 3 = 2.

## Notes

1. [Geeks for geeks](http://www.geeksforgeeks.org/write-a-c-program-to-calculate-powxn/)
1. [SO post](https://stackoverflow.com/questions/101439/the-most-efficient-way-to-implement-an-integer-based-power-function-powint-int)
1. [SO](https://stackoverflow.com/questions/2177781/how-to-calculate-modulus-of-large-numbers)
1. [Career Cup](https://www.careercup.com/question?id=22767685)
