Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i = 0;
- int total = 0;
- while (i < 1000)
- {
- if (i % 3 == 0 || i % 5 == 0)
- total = total + i;
- i++;
- }
- cout << "The total is: " << total << endl;
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment