1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
int Fib1 = 1;
int Fib2 = 2;
int Fib3 = 0;
int randomynumber;
int Loop;
while (Loop < 100) {
Fib3 = Fib2 + Fib1;
Fib1 = Fib2;
Fib2 = Fib3;
randomynumber = Fib2 % 17;
cout << randomynumber << " ";
if (Loop % 10 == 0) {
cout << "\n"
}
}
|
this returns negative numbers sometimes
what did i do wrong
side note this is not the complete program it is only the part with the problem because the complete code is sort of longish and very confusing
Last edited on
Last edited on
thanks that worked perfectly
i didn't expect them to get so big so fast
Last edited on