I'm kinda new at c# programming so take it easy on me.
I couldn't find the answer to my (most likely) simple an stupid question (there's no stupid questions!!) so I post here.
I need to write a program which shows numbers from 1 to 10 that aren't divisble by 2, 3 and 8 using "continue" instruction.
My code:
static void Main(string[] args)
{
for (int i = 1; i <= 10; i++)
{
if (i % 2 == 0 && i % 3 == 0 && i % 8 == 0) continue;
Console.Write("{0} ", i);
}
Console.ReadKey();
}
It doesn't work, tho. The main issue is using &/&& operator. It should return both true and true. Help :(