Hi all,
Hopefully someone can help me out. I'm new to programming, and for class, we have to make a program that determines the day of the week of a specific date that the user enters. I keep getting an error "expression result unused" and I can't figure out why. Here's part of my source code:
I get the issue when I try to get the cin for day and year. Any advice?
Thanks in advance!
Hopefully someone can help me out. I'm new to programming, and for class, we have to make a program that determines the day of the week of a specific date that the user enters. I keep getting an error "expression result unused" and I can't figure out why. Here's part of my source code:
Code:
int month, day, years, LTYear, total, Gtotal;
cout<<"Input date in M/DD/YYYY format. (ex. 2/07/1990 or 10/13/2010)"<<endl;
cin>>month; day; years;
if (month==2 && years%4==0 && years%100!=0 && day>=30)
cout<<"Invalid day.\n";
else if (month==2 && day>=29)
cout<<"Invalid day.\n";
if (day<=1||day>31)
cout<<"Invalid day.\n";
if (years<1900 || years>2099)
cout<<"Invalid year.\n";
I get the issue when I try to get the cin for day and year. Any advice?
Thanks in advance!
Last edited by a moderator: