ZS Associates Interview Question

Write a code to find a root of a integer.