how about something on the lines of this
correct me if im wrong, just giving it a shot.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char *days[] = { "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday" };
int num;
int newday;
char day[10];
printf( "Enter day of week and number of days between 1000-10000:\n" );
scanf( "%s %d", &day, &num );
if ( num < 1000 || num > 10000 ) {
printf( "Invalid number of days\n" );
exit(EXIT_SUCCESS);
}
newday=num%7;
printf( "newday: %d\n", newday );
if ( strcmp( day, days[0] ) == 0 ) {
printf( "output: %s\n", days[newday] );
}
else if ( strcmp( day, days[1] ) == 0 ) {
printf( "output: %s\n", days[newday] );
}
else if ( strcmp( day, days[2] ) == 0 ) {
printf( "output: %s\n", days[newday] );
}
else if ( strcmp( day, days[3] ) == 0 ) {
printf( "output: %s\n", days[newday] );
}
else if ( strcmp( day, days[4] ) == 0 ) {
printf( "output: %s\n", days[newday] );
}
else if ( strcmp( day, days[5] ) == 0 ) {
printf( "output: %s\n", days[newday] );
}
else if ( strcmp( day, days[6] ) == 0 ) {
printf( "output: %s\n", days[newday] );
}
else {
printf( "not valid input day\n" );
exit(EXIT_SUCCESS);
}
return 0;
}