how to write a program that can accept a date from user and print the day on which it occurs
Er, did you mean to start a poll with a random question in it?
To answer your (post) question:
numberOfDays%7to get the answer.
What do you have so far?
I voted yes. Partly, because I am psychic and I can tell the OP's code is thousands of pages long.
The struct tm in time.h or ctime contains an integer that represents the day of the week. After getting the date from the keyboard just fill in a struct tm and pass it to mktime() to complete the structure. You must zero out all the elements of the structure before doing that.