I have the program ready but would like to give a part of it so that you can work on the main logic and go ahead.

Initialize the variables as
Code: C
int month[]={{31},{28},{31},{30},{31},{30},{31},{31},{30},{31},{30},{31}};
Then check for Leap Year
Code: C
if((yr%4==0)&&((yr%100!=0)||(yr%400==0)))
    month[1]=29;
Then you can use the below code to display the calender
Code: C
void days(int *m,int *yr)
{
    int i,md=0,leap=0,track;
    unsigned int d,yrd;
    for(i=Y;i<*yr;i++)
    {
        if((i%4==0)&&((i%100!=0)||(i%400==0)))
            leap++;
    }
    for(i=0;i<(*m-1)&&(i<11);i++)
        md=md+month[i];
    yrd=(*yr-Y)*365;
    d=yrd+leap+md;
    track=d%7;
    display(&track);
}
void display(int *track)
{
    int t,dt,loop;
    t=*track;
    printf("\n\n\n\n\t\t");
    printf("Mon\tTues\tWed\tThurs\tFri\tSat\tSun\n\n");
    for(loop=0;loop<t+2;loop++) /*t+2 due to two additional \t*/
        printf("\t");
    for(dt=1;dt<=month[m-1];dt++)
    {
        if(t%7==0 && t!=0)
            printf("\n\n\t\t");
        printf("%d\t",dt);
        t++;
    }
}
Thanks
Shabbir