Hello, I need to make a check whether the input number is divided into 12, C [closed]

I need to check if the input number is divided by 12 using bitwise operations, without the use of cycles and transitions to hexadecimal number system

I actually did first in the hexadecimal number system, after which I was told that it was too complicated code, when I did through the loop, I was told to use cycles is impossible, and how without using the above-mentioned to solve this problem I do not know. с

  • 3

    Welcome, it is expected that you post a Minimal Reproducible Example, the shortest complete code that shows what you tried. And post the inputs, the expected output and the actual output. May I suggest you take the Tour and read How do I ask a good question?

    – 

  • I assume you mean ‘Is the entered integer an integer multiple of 12?’. You can check it is a multiple of 4 easily by checking the 2 least significant bits are zero. Checking for divisibility by 3 is trickier, but there are tricks you can search for.

    – 

  • Check here to learn how to do this: stackoverflow.com/questions/33084908/…

    – 

  • Does this answer your question? How do I check if an integer is even or odd?

    – 

  • 1

    What you want to check is if the input number is even divisible by 12. And for that there’s a very handy operator that your learning material or teacher should have mentioned before giving you the current exersice.

    – 

Leave a Comment