aboutsummaryrefslogtreecommitdiffstats
path: root/01-Multiples-of-3-and-5/euler1.c
blob: d89956e07773e7a1e46e5e23116acf4cff184000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
#include <stdlib.h>
//Problem 1: multiples of 3 and 5
int main(){
	int max = 1000;
	int i; double sum;
	
	for (i=0;i<max; i++)
		if(i%3 == 0 || i%5==0)
			 sum+= (double) i;
	
	printf("%f\n", sum);
}