I'm a java student and I just started using project euler to keep me practicing code writing and just typing in general. I'm currently stuck on the 7th question and can't find what's wrong with my code.
public static void main(String[] args)
{
int num, remainder, divisor;
boolean working = true;
num = 2;
for(int count = 0; count <= 10001; count++)
{
divisor = num - 1;
remainder = 1;
working = true;
while(working != true)
{
remainder = 1;
divisor = num - 1;
while(remainder!=0)
{
remainder = num%divisor;
if(divisor==1);
{working = false;}
divisor--;
}
num = num++;
}
}
//System.out.println(num -1);
}
The output I get is 1 and I can't figure out why. I am very new to coding so please dont get to frantic over my code if it's bad and inefficient LOL.