I have a programming class and currently has a homework to show the holiday name based on the month and day entered by a user in C program.
Whenever I compile and run the program, there is no error. However, if I enter any month and hit enter, it just returns New year's day and it does not ask for the date. It is supposed to require both the month and the date then display the corresponding holiday but it seems to be not working.
I was wondering if you could provide inputs on what would be the correct syntax.
Below is the code I tried to create:
#include <stdio.h>
int main () {
char m;
int d;
printf("Enter Month: ");
scanf("%c", &m);
printf("Enter Date: ");
scanf("%d",&d);
if (m ="January" && d == 1)
printf("New year's day ");
else if (m ="July" && d ==1 )
printf("Canada day ");
else if (m = "December" && d ==25)
printf("Christmas day ");
else
printf("%c %d does not correspond to a fixed-date holiday ", m, d);
return 0;
}