Enter your full name: Mary Smith
Your full name is Mary Smith.
but I don't know how. what i did was i made two arrays. the first array was for the first name and the second array was for the last name. So the program would look like this already..
Enter your first name: Mary
Enter your last name: Smith
Your full name is: Mary Smith
but the problem would occur when writing the first name, for example:
Enter your first name: Mary Grace
Enter your last name: Your full name is Mary Grace.
The second and third line would print suddenly. And this is not how i want my program to be..
My source code of my program looks like this:
Expand|Select|Wrap|Line Numbers
- #include <stdio.h>
- int main()
- {
- unsigned a[10],b[10];
- printf("Enter your first name: ");
- scanf("%s",a);
- printf("Enter your last name: ");
- scanf("%s",b);
- printf("%s",a);
- printf(" ");
- printf("%s",b);
- return 0;
- }