every odd no. has "1" in its last bit and every even no has "0" (in binary)
eg-
2=0010 ,3=0011
4=0100 ,5=0101....and so on
so just logically "AND" the no with "01H" using instruction [HAVING THAT NO. IN ACCUMULATOR (A)]
ANI 01H
so if the no. is even =>
A=0 (and zero flag is set i.e. "1"
but if the no is odd then => A=1
means zero flag is reset i.e. "0"
so using instruction "JZ"
you can find if the no. if even or odd. :)
Chat with our AI personalities
"IT IS ALWAYS A ODD"
No. Sum of odd + odd = even Sum of odd + even = odd Sum of even + even = even
an odd numberSubtracting an odd number from an even number will always result in an odd number.
Your question is incomplete. Adding an even number with an odd number will always result in an odd number. Multiplying an even number with an odd number will always result in an even number.
The sum of an odd number and an even number is an odd number.