I wrote a program which should compute the sum of all of the multiples of 3 or 5 below 1,000.
This program produces 266,333. According to the internet the correct answer is 233,168 which I verified in another program in ruby. Any thoughts as to why I am getting this incorrect result?Code:int main() { int sum = 0; int i; for (i=0; i < 1000; i++) { if (i % 3 == 0) sum += i; if (i % 5 == 0) sum += i; } printf(" \n\n%i\n\n", sum); return 0; }