How to write a code in C language without arithmetic operators and without if/switch?

Asked

Viewed 20 times

-2

I need to write a code in C that indicates whether the integer is even or odd. The program has to show 0 when it is even and 1 when it is odd. However, the teacher placed the restrictions described in the title: you cannot use arithmetic operators (*,/ and %) or if/switch. It’s essentially something simple that fulfills its function, but I’m not sure where to start.

  • https://ideone.com/BDQxgG

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.