63 845
Assignments Done
99,2%
Successfully Done
In August 2018

Answer to Question #55544 in C for Amir

Question #55544
Write a program that asks for your first name and last name, and then prints the names in the format last name, first name
Expert's answer
/*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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions