QUOTE(NickDMax @ 3 Aug, 2008 - 10:47 AM)

You should really use "#include <iostream>" rather than "iostream.h" -- of course if you do use "iostream" then you will need to add the lines:
CODE
using std::cout;
using std::cin;
using std::endl;
or you could simplify things by using
using namespace std;you also should not use "void main()" -- main returns a value so to be logically consistent you should "int main()". The of course means that you should add a "return 0;" to the end of the main() function.
You use global variables! Don't use global variables! The only global variables you should use are constants. Otherwise they are a really bad idea that tends to lead to some very hard to find irritating bugs where a variables value is changed outside the logic of the current process.
this:
m=m++; is bad, it should be
m++;.
if you think about it:
m=m++; would be something like
m = m = m + 1;While we are at it:
r = (r * 2); can be written as
r *= 2;okay cool, didn't know I could just simply use r*=2 and m++, thx for the tip will do.
And yeah, will try to make do without global variables too...
But what's with <iostream> instead of iostream.h, I mean what's the difference?