commit 5f6255e6e2e66ede994b024ed8d074f101912fae Author: aj Date: Fri Feb 8 18:53:34 2019 +0000 completed multiples of 3 and 5 diff --git a/multiplesOf3and5/multiple.c b/multiplesOf3and5/multiple.c new file mode 100644 index 0000000..5bf618d --- /dev/null +++ b/multiplesOf3and5/multiple.c @@ -0,0 +1,15 @@ +#include + +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); +}