what is wrong with this?
i keep getting an error that says
error C2059: syntax error : 'if' &&
error C2059: syntax error : 'else'
int main (void);
void menu(void);
int getChoice(void);
int *year, *day, *month, julianday;
int dayspermonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int sum_array(int, int dayspermonth[]);
void calendarToJulian(void);
void getCalendarDate(int *month, int *day, int *year);
if (*month == 1)
calendarToJulian = *year *day;
else if (*month == 2)
calendarToJulian = *year sum_array(dayspermonth, 1) + *day;
else if (*month == 3)
calendarToJulian = *year sum_array(dayspermonth, 2) + *day;
else if (*month == 4)
calendarToJulian = *year sum_array(dayspermonth, 3) + *day;
else if (*month == 5)
calendarToJulian = *year sum_array(dayspermonth, 4) + *day;
else if (*month == 6)
calendarToJulian = *year sum_array(dayspermonth, 5) + *day;
else if (*month == 7)
calendarToJulian = *year sum_array(dayspermonth, 6) + *day;
else if (*month == 8)
calendarToJulian = *year sum_array(dayspermonth, 7) + *day;
else if (*month == 9)
calendarToJulian = *year sum_array(dayspermonth, 8) + *day;
else if (*month == 10)
calendarToJulian = *year sum_array(dayspermonth, 9) + *day;
else if (*month == 11)
calendarToJulian = *year sum_array(dayspermonth, 10) + *day;
else if (*month == 12)
calendarToJulian = *year sum_array(dayspermonth, 11) + *day;
void julianToCalendar(void);
void getJulianDate(int julianday, int *year);
if (julianday <= 31)
julianToCalendar = *year 1 julianday;
else if (julianday <=59)
julianToCalendar = *year 2 julianday-31;
else if (julianday <=90)
julianToCalendar = *year 3 julianday-59;
else if (julianday <=120)
julianToCalendar = *year 4 julianday-90;
else if (julianday <=151)
julianToCalendar = *year 5 julianday-120;
else if (julianday <=181)
julianToCalendar = *year 6 julianday-151;
else if (julianday <=212)
julianToCalendar = *year 7 julianday-181;
else if (julianday <=243)
julianToCalendar = *year 8 julianday-212;
else if (julianday <=273)
julianToCalendar = *year 9 julianday-243;
else if (julianday <=304)
julianToCalendar = *year 10 julianday-273;
else if (julianday <=334)
julianToCalendar = *year 11 julianday-304;
else if (julianday <=365)
julianToCalendar = *year 12 julianday-334;
int isLeapYear(int year);
int dayspermonthleap[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int sum_array(int, int dayspermonthleap[]);
void calendarToJulian(void);
void getCalendarDate(int *month, int *day, int *year);
if (*month == 1)
calendarToJulian = *year *day;
else if (*month == 2)
calendarToJulian = *year sum_array(dayspermonthleap, 1) + *day;
else if (*month == 3)
calendarToJulian = *year sum_array(dayspermonthleap, 2) + *day;
else if (*month == 4)
calendarToJulian = *year sum_array(dayspermonthleap, 3) + *day;
else if (*month == 5)
calendarToJulian = *year sum_array(dayspermonthleap, 4) + *day;
else if (*month == 6)
calendarToJulian = *year sum_array(dayspermonthleap, 5) + *day;
else if (*month == 7)
calendarToJulian = *year sum_array(dayspermonthleap, 6) + *day;
else if (*month == 8)
calendarToJulian = *year sum_array(dayspermonthleap, 7) + *day;
else if (*month == 9)
calendarToJulian = *year sum_array(dayspermonthleap, 8) + *day;
else if (*month == 10)
calendarToJulian = *year sum_array(dayspermonthleap, 9) + *day;
else if (*month == 11)
calendarToJulian = *year sum_array(dayspermonthleap, 10) + *day;
else if (*month == 12)
calendarToJulian = *year sum_array(dayspermonthleap, 11) + *day;
void julianToCalendar(void);
void getJulianDate(int julianday, int *year);
if (julianday <= 31)
julianToCalendar = *year 1 julianday;
else if (julianday <=60)
julianToCalendar = *year 2 julianday-31;
else if (julianday <=91)
julianToCalendar = *year 3 julianday-60;
else if (julianday <=121)
julianToCalendar = *year 4 julianday-91;
else if (julianday <=152)
julianToCalendar = *year 5 julianday-121;
else if (julianday <=182)
julianToCalendar = *year 6 julianday-152;
else if (julianday <=213)
julianToCalendar = *year 7 julianday-182;
else if (julianday <=244)
julianToCalendar = *year 8 julianday-213;
else if (julianday <=274)
julianToCalendar = *year 9 julianday-244;
else if (julianday <=305)
julianToCalendar = *year 10 julianday-274;
else if (julianday <=335)
julianToCalendar = *year 11 julianday-305;
else if (julianday <=366)
julianToCalendar = *year 12 julianday-335;
FILE *csis;
int main(void) {
int choice;
csis = fopen("csis.txt", "w");
do {
choice = getChoice();
switch (choice) {
case 1 : calendarToJulian(); break;
case 2 : julianToCalendar(); break;
case 3 : break;
}
}
while (choice !=3);
return 0;
}
int isLeapYear(int year) {
return ((!(year % 4) && year % 100) || !(year % 400));
}