Using [code] [/code] tags makes posted code easier to read.
Code:
void get_data(int *year, int *month, int *day)
{
printf("\nEnter the Month of the Person's Birthdate:\n");
scanf("%d", &month); /* month is a pointer, remove the '&' */
printf("\nEnter the Day of the Person's Birthdate:\n");
scanf("%d", &day); /* day is a pointer, remove the '&' */
printf("\nEnter the Year of the Person's Birthdate:\n");
scanf("%d", &year); /* year is a pointer, remove the '&' */
printf("\nHere is the date entered: %d/%d/%d\n", *month, *day, *year);
return;
}
Code:
void print_results(int total)
{
/* Local Definitons */
int days;
switch ( days ) /* Symbol 'days' not initialized */
{
case 0 : printf("Sunday\n");
break;
case 1 : printf("Monday\n");
break;
case 2 : printf("Tuesday\n");
break;
case 3 : printf("Wednesday\n");
break;
case 4 : printf("Thursday\n");
break;
case 5 : printf("Friday\n");
break;
case 6 : printf("Saturday\n");
break;
}
printf("\nThe Person's Birthday Is On: %d\n", days);
getch();
return;
} /* Symbol 'total' not referenced */
There are still problems with the calculations, I didn't look into that.
Code:
Enter the Month of the Person's Birthdate:
4
Enter the Day of the Person's Birthdate:
22
Enter the Year of the Person's Birthdate:
2003
Here is the date entered: 4/22/2003
Wednesday
The Person's Birthday Is On: 3