# C / Programming Help?

**URL:** <https://forum.kirupa.com/t/c-programming-help/205201>\
**Category:** random\
**Created:** [October 27, 2006, 2:04am UTC](https://forum.kirupa.com/t/c-programming-help/205201 "2006-10-27T02:04:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![REEF](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@REEF](https://forum.kirupa.com/u/REEF)\
**Post date:** [October 27, 2006, 2:04am UTC](https://forum.kirupa.com/t/c-programming-help/205201/1 "2006-10-27T02:04:25Z")

</div>

Please move this somewhere, because Im not sure where to put it, this is for school btw.

Okay so who knows C? I need help on some modulus stuff, the code needs to detect if x is even, odd, and if it’s either, it also needs to check if its divisible by 3. This should work for any value of x. I have the even/odd detection so far:

```auto
int x = 5;
void main ()
{
    while (x > 0)
      {
        if (x%2 == 0)
          {
            printf("x is %d: even
", x);            
        } else  
          {          
            printf("x is %d: odd
", x);              
        }
        x--;
    }
}

```

Thanks for any help. AS people might get this too!
