@ -0,0 +1,18 @@ | |||||
#include <stdio.h> | |||||
int main (void) { | |||||
char first_name[20]; | |||||
char last_name[20]; | |||||
printf("Your first name: "); | |||||
scanf("%s", first_name); | |||||
printf("Your last name: "); | |||||
scanf("%s", last_name); | |||||
printf("Your name is %s, %s\n", last_name, first_name); | |||||
return 0; | |||||
} |
@ -0,0 +1,19 @@ | |||||
#include <stdio.h> | |||||
#include <string.h> | |||||
int main (void) { | |||||
char first_name[20]; | |||||
printf("Your first name: "); | |||||
scanf("%s", first_name); | |||||
printf("Your name: \"%s\"\n", first_name); | |||||
printf("Your name: \"%20s\"\n", first_name); | |||||
printf("Your name: \"%*s\"\n", (int)(strlen(first_name)+3), first_name); | |||||
return 0; | |||||
} |