0
Can you tell me where's the problem in my code? It's always printing 'Oops! We missed your Birthday.'
#include <stdio.h> int main() { char bd_month[10]; int bd_date; printf("When is your birthday?\n"); scanf("%d %s", &bd_date, &bd_month); if (bd_date == 5 && bd_month == 'november') printf("Happy Birthday to you!"); else if (bd_date >= 6 && bd_month == 'november') printf ("Happy Birthday in advance!"); else if (bd_month == 'december' || bd_month == 'january') printf ("Happy Birthday in advance!"); else printf ("Oops! We missed your Birthday."); return 0; }
3 odpowiedzi
0
NotAPythonNinja Mmm....can't I run this code correctly without using strcmp?
Btw I have tried to run code without '&'. But it's showing error.
0
NotAPythonNinja Thank you so much bro! Btw does 0 mean true here?
0
What about positive and negative value?NotAPythonNinja