Here is a snippet of my code. The problem here is whenever I try to get a string input and put a white space in between (eg: name: John Michael), it skips the following scanf and proceeds to the third one which is the type. the skipping depends on how many white space I input (eg: 3 white spaces in name means, it skips three scanfs and prompts the fourth one)
why is this happening?
int main (){
char name, address, type[20], date, type1[20], type2[20];
float previous, present, consumed_watts, bill;
printf("Enter details below (PLEASE REFRAIN FROM USING SPACE, USE '_' INSTEAD!)");
printf("\n\nEnter account name: ");
scanf("%s", &name);
printf("Enter address: ");
scanf("%s", &address);
printf("Enter type (residential or business): ");
scanf("%s", &type[20]);
printf("Enter previous reading: ");
scanf("%f", &previous);
printf("Enter present reading: ");
scanf("%f", &present);
printf("Enter date: ");
scanf("%s", &date);