Walt Disney Company

Work in HR? Unlock Free Profile

Interview Question

Software Engineer Interview Seattle, WA

Write code to reverse the digits in an integer.


Interview Answer

1 Answer


int reverse(int a) {
        int b = 0;
        while (a>0) {
            b *= 10;
            b += a%10;
            a /= 10;
        return b;

no one on Mar 1, 2013

Add Answers or Comments

To comment on this question, Sign In with Facebook or Sign Up