I am stuck with the first project in C about dates and switches. The code runs this way:
int main(void) {
int month, day, year;
// Standard date form
printf(“Enter date (mm/dd/yyyy): “);
// Split the user input into 3 variables for the date
// Don’t worry about the scanf()
below, you’ll learn more about these later!
scanf(”%d /%d /%d”, &month, &day, &year);
// Print the month
switch(month) {
case 1:
printf(“January\n”);
break;
case 2:
printf(“February\n”);
break;
case 3:
printf(“March\n”);
break;
case 4:
printf(“April\n”);
break;
case 5:
printf(“May\n”);
break;
case 6:
printf(“June\n”);
break; // and so on until case 12 for January…
The compiler displays this error message:
$ gcc date.c
date.c: In function ‘main’:
date.c:60:1: error: expected declaration or statement at end of input
}
^
I’m stuck on this because I could not figure out the error message and therefore could not proceed with the next task. I hope somebody can help me with this. Thank you very much…