printf("\nEnter your age: ");
scanf("%d", &age);
printf("Enter name: ");
scanf("%c", &name);// first name and last name (**problem occurs here**)
printf("\nEnter your middle name: ");// this line skipped
scanf("%s", &middle);
CodePudding user response:
Use gets(variable name); instead
CodePudding user response:
use scanf(" %[^\n]",variable name);