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:
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!