I feel like I am making this problem way more complicated than it should be. All I'm trying to do is print out the numbers that are below 1000 that are divisible by 3 or 5.
#include <iostream>
#include <cmath>
usingnamespace std;
int main()
{
int number = 1000;
int x = 1;
cout << "Calculating all of the numbers below 1000 that are divisible by 3 and 5...";
while (x <= 1000)
{
if (x % number == 0)
{
cout << (x / number) << endl;
x++;
}
else
{
x++;
}
}
return 0;
}