include iostream int multiplethree int multiplefive using namespace st

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#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