projectEuler_C/multiplesOf3and5/multiple.c
2019-02-08 18:53:34 +00:00

16 lines
257 B
C

#include <stdio.h>
int main(void){
int upperbound = 1000;
int total = 0;
int i;
for(i = 0; i < upperbound; i++)
if(i % 3 == 0 || i % 5 == 0)
total += i;
printf("the total of all multiples of 3 and 5 up to %i is %i\n", upperbound, total);
}