Skip to content

Instantly share code, notes, and snippets.

@DivinityArcane
Last active August 29, 2015 14:06
Show Gist options
  • Save DivinityArcane/84d076eb1443708d2009 to your computer and use it in GitHub Desktop.
Save DivinityArcane/84d076eb1443708d2009 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char** argv) {
int num = 0;
char buf[12];
puts("Enter a number: ");
fgets(buf, 12, stdin);
num = atoi(buf);
printf("The number you entered was: %i\n", num);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment