Pascal Program(10 points)

2006-12-02 7:23 pm
how to write a program that can let the computer to selsct even number and odd number?

回答 (1)

2006-12-02 10:03 pm
✔ 最佳答案
I cannot understand your question in fact, but if you are meaning that you want the computer to determine if a input number is an even number or odd number, then the following may help you.

Program answer;
var input: integer;
begin
writeln ('Please input a number:');
readln (input);
If (input mod 2)=0 then
writeln ('It is an even number')
else
writeln ('It is an odd number');
end.


收錄日期: 2021-04-13 15:34:36
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20061202000051KK01214

檢視 Wayback Machine 備份