I cannot get the following to compile correctly; #include<stdio.h> #include<stdl
ID: 3641956 • Letter: I
Question
I cannot get the following to compile correctly;
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int i;
char; fullname[20];char first[20];char last[20];
printf("Enter lastname, first or end to quit");
scanf("%s",fullname);
while(strcmp(fullname);
{
for(i=0,j=0;fullnane[i] !=' , ';i++)
last[i] = '; i++;
for(;i<strlen(fullname);i++, j++)
first[j]= fullname[i];
first[j]= '';
printf("Enter lastname, first or end to quit");
scanf("%s", fullname);
}
system("PAUSE");
return 0;
}
the assignment is Write a program using a user-terminated loop that accepts names in Lastname, Firstname order and converts them into Firstname Lastname. The input name should be a single character string. Search for the comma to separate it into two strings to display it in the correct format.