title: C++ error expression cannot be used as function
body: <p>How can I edit my formula for </p>
  
  <pre><code>weekday=(day+2(month)+3(month)/5+year+year/4-year/100+year/400)/7
  </code></pre>
  
  <p>so that I dont get an error message saying "expression cannot be used as a function"?</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  int main()
  {
  int date=0;
  int month=0;
  int day=0;
  int year=0;
  int leftover=0;
  int weekday=0;
  
  cout&lt;&lt;"Enter Date (ex.20140912) :";
  cin&gt;&gt;date;
  
  year=date/10000;
  leftover=date%10000;
  month=leftover/100;
  day=date%100;
  {
  if (month==3)
      {cout&lt;&lt;"March "&lt;&lt; day&lt;&lt;", "&lt;&lt; year&lt;&lt;":";
          weekday=(day+2(month)+3(month)/5+year+year/4-year/100+year/400)/7;
  
              if (weekday==0)
                  {cout&lt;&lt;"Saturday";
                  }
              if (weekday==1)
                  {cout&lt;&lt;"Sunday";
                  }
              if (weekday==2)
                  {cout&lt;&lt;"Monday";
                  }
              if (weekday==3)
                  {cout&lt;&lt;"Tuesday";
                  }
              if (weekday==4)
                  {cout&lt;&lt;"Wednesday";
                  }
  </code></pre>