#include <stdio.h>
#include <string.h>
enum a{sun,mon,tue,wed};
int main(){
enum a d;
char da[10];
scanf("%s",da);
if(!strcmp(da,"mon")){//here if takes mon and compares we get 0
d=1; //but as of not we get one and executes this
}
else if(!strcmp(da,"sun")){//by default the sun comes in this fn only
d=0;
}
else if(!strcmp(da,"tue")){//so since the sting exacly comes to fn where its string present
d=2; // we get the correct result
}
switch(d){
case sun:
printf("sunday");
break;
case mon:
printf("monday");
break;
case tue:
printf("tuesday");
break;
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: