P
pete
Robert said:By definition, a number that is a power of 2 has no prime factors other
than 2, your observation is an incomplete obfuscation of this fact.
Also, just so you know, any number evenly divisible by 9 is also evenly
divisible by 3 so the last part of your assertion is superfluous.
Your example has numerious errors, both programatic and logical.
First, let's cover the programatic errors:
1. main returns an int so "int main (void)" would be a correct
declaration here.
2. You never define "n", let alone initialize it.
3. You need to #include <stdio.h> to use printf and you should have a
newline at the end of your string to be portable.
4. You should return an integer value from main.
And this expression
(n%3 && n%5 && n%7 && n%9 != 0 )
is written strangely.
Either
(n%3 && n%5 && n%7 && n%9)
or
(n%3 != 0 && n%5 != 0 && n%7 != 0 && n%9 != 0 )
would be better.