#include <iostream>
int multiplethree();
int multiplefive();
using namespace std;
int main()
{
int three = 0, five = 0, total = 0;
three = multiplethree();
five = multiplefive();
total = three + five;
cout << "total is " << total <<endl;
return 0;
}//end main
int multiplethree()
{
int y = 0, storage = 0, mod = 0;
y = y + 3;
storage = storage + y;
cout << "y = " << y << endl;
cout << "storage = " <<storage << endl;
while (y < 999)
{
y = y + 3;
mod = y % 5; //isolate the multiple of fives
if(mod != 0) //remove multiples of five from grand total
{
storage = storage + y;
}
cout << "y = " << y << endl;
cout << "storage = " <<storage << endl;
}//end while
return storage;
}//end multiplethree
int multiplefive()
{
int z = 0, container = 0;
z = z + 5;
container = container + z;
cout << "z = " << z << endl;
cout << "container = " <<container << endl;
while (z < 1000)
{
z = z + 5;
if(z < 1000)
container = container + z;
}
cout << "z = " << z << endl;
cout << "container = " <<container << endl;
return container;
}//end multiplefive