1. ## Don't quite understand..

if user inputs Monday and 'n' = 3, your output should be Thursday.

user input = day of the wk & number of days from now (between 1000<_ n <_10000)

they want to use a strcmp and the mod operator

Im a little lost on why...and how

2. strcmp is probably used to determine which day was entered. The modulus operator is used to wrap around an array so that if you go past the end, you start over at the beginning:
Code:
```#include <stdio.h>
#include <string.h>

#define NDAYS 7

static char *days[] = {
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
};

static int dayValue(char *day)
{
int i;

for (i = 0; i < NDAYS; i++)
{
if (strcmp(day, days[i]) == 0)
break;
}

return i;
}

int main(void)
{
int n = 3;

printf("%s\n", days[(dayValue("Monday") + n) % NDAYS]);
printf("%s\n", days[(dayValue("Sunday") + n) % NDAYS]);
printf("%s\n", days[(dayValue("Thursday") + n) % NDAYS]);

return 0;
}```

3. ## thank you

thank you for your quick response.
Not working for me but it's coming along.

QUESTION:
The user inputs the day (monday) then inputs a number between 1000 and 10000 days.
How would you figure out what day it is from the number they inputted?

4. >The user inputs the day (monday) then inputs a number between 1000 and 10000 days.
The above method should work for any number of days provided you don't take leap days into account.

5. >Not working for me but it's coming along.
>The user inputs the day (monday) then inputs a number between 1000 and 10000 days.

strcmp is case sensitive ("monday" is not the same as "Monday").

This is a slightly modified version of Brighteyes' code to demonstrate the case sensitivity.
Code:
```#include <stdio.h>
#include <string.h>

#define NDAYS 7

static const char *days[] = {
"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday",
};

static int dayValue(const char *day)
{
int i;
for ( i = 0; i < NDAYS; i++ )
{
if ( strcmp(day, days[i]) == 0 )
{
return i;
}
}
return -1;
}

void foo(const char *day, int n)
{
int dow = dayValue(day);
printf("%s + %d = ", day, n);
if( dow >= 0)
{
puts(days[(dow + n) % NDAYS]);
}
else
{
}
}

int main(void)
{
const char myday[] = "Friday";
int n = 1234;
foo("Monday", 5);
foo("monday", 5);
foo("Tuesday", 9);
foo(myday, n);
return 0;
}

/* my output
Monday + 5 = Saturday
Tuesday + 9 = Thursday
Friday + 1234 = Sunday
*/```

6. ## thanks

thank you guys.
but don't have to use functions this time

7. Am I the only one in doing strings that always puts them as caps? I always toupper everything thats inputted by the user. Maybe its bad programming on my end. :P

8. No, Twiggy, it's not bad programming. I always use toupper() also. It's just whatever habit you get into.

Walt