while ( balance < 2.00)
{
balance += ((percent/100)*balance);
years++;
}


That's an infinite loop.
1 / 100, 24 / 100, calculated as Integers equate to 0.