COMS 3101-3: Programming Languages (C)

Write a program that takes a date as input and prints out the day of the week corresponding to the date.

For example:

Input:
        12-18-2009
Ouput:
        It is a friday!

The input is in the following format: mm-dd-yyyy

The date could either be in the past or in the future.

Modularize your code by writing 3 or more functions.

Finally test your code with your birth date and check if you get the right answer!

Hints:

if (year%400 == 0 || (year%100 != 0 && year%4 == 0))
{
        printf("Year %d is a leap year", year);
}