Created
April 26, 2012 02:40
-
-
Save flightcrank/2495309 to your computer and use it in GitHub Desktop.
challange_1_e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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