Skip to content

Instantly share code, notes, and snippets.

@jose-marquez89
Created September 21, 2020 00:26
Show Gist options
  • Save jose-marquez89/daba618fb852ecf43b127f14de352ac4 to your computer and use it in GitHub Desktop.
Save jose-marquez89/daba618fb852ecf43b127f14de352ac4 to your computer and use it in GitHub Desktop.
int reverse(int x) {
char *buffer = malloc(sizeof(int) * (log10(x) + 1));
char new[3];
sprintf(buffer, "%d", x);
printf("%c", buffer[2]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment