Math, asked by tulsikasera4191, 1 year ago

How to find odd and even numbers in given number in c

Answers

Answered by piyush24518
0

Odd or even program in C using modulus operator

We can use bitwise AND (&) operator to check odd or even, as an example consider binary of 7 (0111) when we perform 7 & 1 the result will be one, and you may observe that the least significant bit of every odd number is 1. Therefore (odd_number & 1) will be one always and also (even_number & 1) is always zero.

Attachments:
Similar questions