You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CalendarProg causese the follwoing error in the Semantic Analyser.
It seems Semantic Analyse does not pay attention to the break within the while(true) loop.
TYPE_MISMATCH Line 29 / Column 1-25
Unreachable statement, see previous "return" or "break"
The code:
record {
long year;
long month;
long day;
} [360] calendar;
long i;
long year;
long month;
long day;
i = 0;
year = 0;
month = 0;
day = 0;
while(true) {
year = 2013;
month = (i/30) + 1;
day = i - (30*(month - 1));
calendar[i].year = year;
calendar[i].month = month;
calendar[i].day = day;
if(i + 1 == 360) break;
else i = i + 1;
}
return calendar[359].day;
The text was updated successfully, but these errors were encountered:
CalendarProg causese the follwoing error in the Semantic Analyser.
It seems Semantic Analyse does not pay attention to the break within the while(true) loop.
The code:
The text was updated successfully, but these errors were encountered: