Skip to content

Instantly share code, notes, and snippets.

@flightcrank
Created April 26, 2012 02:40
Show Gist options
  • Save flightcrank/2495309 to your computer and use it in GitHub Desktop.
Save flightcrank/2495309 to your computer and use it in GitHub Desktop.
challange_1_e
/*
create a program that will ask the users name, age, and reddit username.
have it tell them the information back, in the format:
your name is (blank), you are (blank) years old, and your username is (blank)
for extra credit, have the program log this information in a file to be accessed later.
*/
#include <stdio.h>
int main() {
char name[20];
char user_name[20];
int age = -1;
printf("Enter name: ");
scanf("%s",name);
printf("Enter age: ");
scanf("%d",&age);
printf("Enter user name: ");
scanf("%s",user_name);
printf("your name is %s, you are %d years old, and your username is %s\n",name, age, user_name);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment