Thanks for your help, I made a new one which I think should work.
^The reason I put 'x==133745639' was because I wanted each number to be tested against eachother until it came to the factors, at which point 'while(x * y != 133745639)' would break the loop and I would get my answer... Kind of difficult to explain, but my code below is basically a simpler version.
Only, when I try to compile this one below I'm getting
Error E2277 factbrute2.cpp 10: Lvalue required in function main()
*** 1 errors in Compile ***
I have no idea what this message means... (using borland 5.5.1)
Code:
#include <iostream>
using namespace std;
int main()
{
int x,y= 2;
cout << "Please wait: \n";
for(x = 2; (x * y) = 133745638; x++)
{
y++;
}
cout << "\n" << x << " * " << y << " = 133745639";
}
Thanks for telling me about trial division, I'm reading up on it now
EDIT::::::::
I just changed it to this:
Code:
{
int x,y= 2;
cout << "Please wait: \n";
for(x = 2; (x * y) == 133745638; x++)
{
y++;
}
cout << "\n" << x << " * " << y << " = 133745639";
}
And it will compile now, I'm testing it at the moment.
EDIT AGAIN:::::::::::::
Ok that reallly messed up... straight away it just said 2 * 2 = 1337blah...
...Why do my programs always screw up?!