Hello, I'm just starting this whole c programming and I've looked at alot of tutorials and still can't figure out a way to get this basic program to work properly. It keeps saying I have an error somewhere. I tried combining all the conditions in one line as such:
If (d=28; d=29; d=30; d=31);
I've also tried it with or in there and most recently I tried using if/else if/else statements and that didn't work. This is what I currently have:
If someone could guide me in the right direction I would really appreciate it! Thanks!Code:#include <cs50.h> #include <stdio.h> int main(void) { printf("How many days in month?"); int d = GetInt(); if (d=28) { printf("Days in months were: %d\n", d); } if (d=29) { printf("Days in months were: %d\n", d); } else if (d=30) { printf("Days in months were: %d\n", d); } else if (d=31) { printf("Days in months were: %d\n", d); } else { printf("Invalid number of days\n"); } return 0; }