Good evening guys.
I appear to have a problem with my IF condition. I need the condition that states if month>=11 it will substract 1 from the y variable i dont know if im using the right Control statement for this exemple but heres my program so far and please ignore the Month variables that are shown (march, august ect...)since its a start to a program.
#include<iostream>
using namespace std;
int main()
{
int year,month,firstday,d,x,y,march,april,may,june,july,august,september,october;
int november,december,january,february;
cout<<"enter a month between 1 and 12:";
cin>>month;
cout<<endl;
cout<<"enter a year between 1930 and 1999:";
cin>>year;
cout<<endl;
d=1;
x=19;
y=(year-1900);
{if (month>=11)y=y-1;
firstday=(d+(((13*month)-1)/5)+y+(x/4)+(y/4)-2*x)%7;
cout<<"the firstday of themonth is :"<<firstday;}
firstday=(d+(((13*month)-1)/5)+y+(x/4)+(y/4)-2*x)%7;
cout<<"the firstday of themonth is :"<<firstday;
system("pause");
return 0;
}
thank you for your time.