C - Input and Output
What is wrong with this code?
char name[20];
printf("Enter name: ");
scanf("%c", &name);char name[20];
printf("Enter name: ");
scanf("%c", &name);%s should be used, not %c.&name is incorrect; for arrays, just name is used with %s.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions