read number
if number is divisible by 2
display even
else
display odd
end if
2007-10-17 04:10:51
·
answer #1
·
answered by Anonymous
·
1⤊
0⤋
input A
B=A mod 2
if (b=0)
then display "even"
else display "odd"
Mod is a modulous operator available in most languages. It divides the number by 2 then looks at the remainder, not the actual division result.
2007-10-17 11:16:28
·
answer #2
·
answered by tkquestion 7
·
0⤊
0⤋
Pseudocode (derived from pseudo and code) is a compact and informal high-level description of a computer programming algorithm that uses the structural conventions of programming languages, but omits detailed subroutines, variable declarations or language-specific syntax. The programming language is augmented with natural language descriptions of the details, where convenient.
Pseudocode resembles, but should not be confused with, skeleton programs including dummy code, which can be compiled without errors. Flowcharts can be thought of as a graphical form of pseudocode.
2007-10-17 11:08:46
·
answer #3
·
answered by NKeevan 2
·
0⤊
3⤋
function a run
read a number i
if i module 2 = 0 then
i is even else
i is odd
end if
end function
2007-10-17 11:09:47
·
answer #4
·
answered by CLOUND 3
·
0⤊
0⤋
this is really something you should be able to do on your own if you ever ever hope to do ANY programming or even spreadsheet manipulation in the future.
If you need help, then tell us where you are getting stuck.
But since we don't get the grades, don't ask us to do your homework :)
2007-10-17 11:10:01
·
answer #5
·
answered by Barry C 6
·
2⤊
0⤋
if X % 2
then print odd
else print even
2007-10-17 11:09:36
·
answer #6
·
answered by Kevin G 4
·
1⤊
0⤋