Skip to content

Instantly share code, notes, and snippets.

@adnanmasood
adnanmasood / EulerProblem1_MultiplesOf3Or5.cpp
Created March 21, 2023 14:57
euler_problem1_multiples_of_3_or_5
#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;
}