Skip to content

Instantly share code, notes, and snippets.

@alex-lx
Created June 18, 2013 01:59
Show Gist options
  • Select an option

  • Save alex-lx/5802091 to your computer and use it in GitHub Desktop.

Select an option

Save alex-lx/5802091 to your computer and use it in GitHub Desktop.

Revisions

  1. alex-lx created this gist Jun 18, 2013.
    5 changes: 5 additions & 0 deletions reverce_number.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    int reverce_number(int v) {
    int rv = 0, remainder;
    for (; v != 0; remainder = v % 10, v /= 10, rv = rv * 10 + remainder) /* nothing */;
    return rv;
    }