This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() { | |
int sum = 0; | |
for (int i = 1; i < 1000; i++) { | |
// Check if i is a multiple of 3 or 5 | |
if (i % 3 == 0 || i % 5 == 0) { | |
// Add i to the sum if it's a multiple of 3 or 5 | |
sum += i; | |
} |