#include <stdio.h>
char *getday(int num);
int main()
{
int num=4;
char* res;
res=getday(num);
printf("%s",res);
}
char *getday(int num)
{
char *str;
switch(num)
{
case 1:str="monday";
break;
case 2:str="monday";
break;
case 3:str="monday";
break;
case 4:str="monday";
break;
case 5:str="monday";
break;
case 6:str="monday";
break;
case 7:str="monday";
break;
default: printf("invalid");
break;
}
return str;
}
output:
monday
No comments:
Post a Comment