中等ICT-ALGO-008

Which is a syntax error?

A. Using > when the specification says >=, while the rest of the program runs.
B. Dividing by zero while the program is running.
C. Leaving out ENDIF, so the program breaks the language rules and does not run.✓ 答案
D. Testing a mark of 50.

解說

A missing ENDIF breaks the structure, so the program is not run. A wrong comparison that still runs is a logic error. Dividing by zero during a run is a runtime error.

「演算法與偽代碼」全部 12 題 · 資訊及通訊科技 MCQ 題庫