I got interval from 9 to 17. It menas I got 9, 10, 11, 12, 13, 14, 15, 16, 17
Then into cin I enter week day when interval starts. For example I enter 4. It means 4=thursday.
So Number 9 is Thursday, Number 10 is Friday, Number 11 is Saturday, Number 12 is Sunday and so on.
The first thing to do is work out the math. Once you understand that, you can work on the code.
If I understand the problem right, you're given an interval of days of the month (like 9 to 17) and which day of the week is the first day (day 4 = Thursday). Your task is to print out the day of the month and the day of the week for day in the interval.
If I have the problem right, then you can solve it as follows. First, subtract the day of week (4) from the day of month (9) to get the day of the month that is Sunday. 9-4=5 so the 5th is Sunday.
Now for any day of the month, subtract 5 and divide by 7. The remainder will be the day of the week (0=Sunday, 1=Monday, ... 6=Saturday).
This is almost what you want, except it looks like you want to display the day of the week as 1-7 instead of 0-6. Once you figure the day using the formula above, just add 1 to compute the value to display.
I suggest you work a few of these out on pencil and paper. Once you have the hang of it, convert it to code. Have your code print out the intermediate values to help you get it working right. Once it's right, remove the code that prints intermediate values.