Computer Science, asked by swayamsiddha, 7 months ago

write a program to check if a number is even or odd(use % operator). The number can be taken as parameter.{please explain the last line of the question}​

Answers

Answered by anjanashrgwlgmailcom
0

Answer:

If an integer mod 2 is 0 then, it is even and if an integer mod 2 is 1 then, it is an odd number. Even or Odd number can be tested by bitwise operator too. Bitwise & ( AND ) operator can be used to check for even or odd. If ANDing an integer by 1 results 1 then the integer is ODD else ( result 0 ) the integer is EVEN.

please like and brainlist my answer

Similar questions