-1
\$\begingroup\$

Knowing a given date (11/28/1973), and supposing I will die when I'm 99, what are the years when my birthday will be a thursday so that I will be able to party all week-end?

\$\endgroup\$
2
  • \$\begingroup\$ The question as it stands will get only "print xx" answers, since there is no input on which the output is dependant on. \$\endgroup\$
    – shiona
    Commented Dec 29, 2013 at 22:17
  • \$\begingroup\$ This adds nothing interesting to existing questions such as this one. \$\endgroup\$ Commented Dec 29, 2013 at 22:28

2 Answers 2

0
\$\begingroup\$

js

var y = 1973 + 99;
while(y-- > 1973) 4!=new Date('11/23/'+y).getDay()||console.log(y);
\$\endgroup\$
-1
\$\begingroup\$

Something like this:

c#

        var birthdate = new DateTime(1973,11,28);
        for (int i = 0; i <= 99; i++)
        {
            var date = birthdate.AddYears(i);
            if (date.DayOfWeek.Equals(DayOfWeek.Thursday))
            {
                Console.WriteLine(date.Year);
            }
        }
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.