Skip to content

Commit

Permalink
add interactive program sample
Browse files Browse the repository at this point in the history
  • Loading branch information
syohex committed Aug 12, 2012
1 parent dee7104 commit b1daf50
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sample/sample_interactive.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>
#include <stdlib.h>

int main (void)
{
char name[128];
int age;

printf("Your name >> ");
fgets(name, 128, stdin);

printf("Your age >> ");
scanf("%d", &age);

printf("Your name is %s", name);
printf("Your age is %d\n", age);
return 0;
}

0 comments on commit b1daf50

Please sign in to comment.