Project Euler
Problem 19: Counting Sundays

You are given the following information, but you may prefer to do some research for yourself.

How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?


To solve this I make an array with 12 numbers in it, each representing the number of days in a month. I use a for loop to increment the years, calculating whether or not it's a leap year, checking to see if a month begins on the first day of the week.

###,###