C
C
CHESS482020-01-24 21:24:46
Pascal
CHESS48, 2020-01-24 21:24:46

What if Pascal doesn't consider else?

I am writing a simple program:
Program ferma;
const a=9;
begin
if Odd(a) then write (a:2) else write (a*3);
end.
Gives the answer 9, as if not seeing "else write (a*3)" . Where is the mistake? What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2020-01-24
@xmoonlight

9 is odd. That's right.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question