Walt Disney Company

  www.disney.com
  www.disney.com

Interview Question

Software Engineer Interview Seattle, WA

Write code to reverse the digits in an integer.

Answer

Interview Answer

1 Answer

0

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