There are no comments at the top to tell you what the program does. today that may not be important, but in 2 months or 2 years. you also have no comments anywhere, for example:
if(month > dmonth)
without looking at the code, in a year, you just like everyone else, will have no idea what month and dmonth represent.
---
I also don't see any checks to make sure that the date entered is valid.
So if the user enters 13 for the month, the program just accepts that, even though it's wrong.
---
While it may not be desired, since you can enter a date that is not (today).
There is no reason for you to have the user put in the current date, since you can just get that from the computer. Not really a problem with your code, just a user friendly suggestion.
---
Last, when I declare int x; I like to set the value, else the computer uses memory that may already have a value.
for example, try:
1 2 3 4
|
int dmonth;
int dday;
int dyear;
cout << dmonth << " " << dday << " " << dyear << endl;
|
Then try:
1 2 3 4
|
int dmonth=1;
int dday=1;
int dyear=1900;
cout << dmonth << " " << dday << " " << dyear << endl;
|