Yes, I tried that, it works fine.
Here is the code that I used:
#include <iostream>
using namespace std;
int main()
{
int month,day,year,date;
cout<<"Enter a date:";
cin>>date;
month = date / 1000000;
day = (date % 1000000)/10000;
year = date % 10000;
cout<<"Date Entered:"<<date<<endl
<<"Month:"<<month<<endl
<<"Day:"<<day<<endl
<<"Year:"<<year<<endl;
}
And this was the interaction at the terminal:
siddhant3s@x10n:~$ ./test
Enter a date:03081991
Date Entered:3081991
Month:3
Day:8
Year:1991
siddhant3s@x10n:~$