#include int main(){ char name[20]; printf(\"enter a name \"); scanf(\"%s\",name); switch(name[20]){ case \"kevin\" :
Switch statements work on int values (or enum), but not on char arrays.
int
enum
char
You could do
if (strcmp(name, "kevin")==0) { printf("hello"); } else if (strcmp(name, "Laura")==0) { printf("Allo"); } else if (strcmp(name, "Mike")==0) { printf("Good day"); } else { printf("Help!"); }