cout<<"\nEnter Date of Birth";
cin>>date;
cout<<"-";
cin>>month;
cout<<"-";
cin>>year;
In this code, I want the input to be taken as 25-02-1994
(the dashes appear automatically after the preceding value is entered).But,instead a '\n
' is appended automatically and the input is taken as
Enter Date of Birth25
('\n')-02
('\n')-1994
I had to mark ('\n
') to mark that the dashes appear on a new line.Any suggestions??