Write a program that asks for your first name and last name, and then prints the names in the format last name, first name
/*Question #55544, Programming C*/
#include <stdio.h>
int main()
{
char name[32];
char lastname[32];
printf("Enter the name: ");
gets(name); /* this function is unsafe, compiler may give warning*/
printf("Enter the last name: ");
gets(lastname);
printf("%s %s\n", lastname, name); /*print last name and first name*/
system("PAUSE"); /*sys delay*/
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C