title: Assigning DayTime to Variable
body: <pre><code>using System;
  using System.Globalization;
  
  namespace _13._Holidays_Between_Two_Dates
  {
      class Program
      {
          static void Main(string[] args)
          {
              var startDate = DateTime.ParseExact(
                Console.ReadLine(), "d.m.yyyy", CultureInfo.InvariantCulture);
  
              var endDate = DateTime.ParseExact(
                Console.ReadLine(), "d.m.yyyy", CultureInfo.InvariantCulture);
  
              var holidaysCount = 0;
  
              // Problem: infinite loop
              for (var date = startDate; date &lt;= endDate; date.AddDays(1))
              {
                  if (date.DayOfWeek == DayOfWeek.Saturday || 
                      date.DayOfWeek == DayOfWeek.Sunday)
                  {
                      holidaysCount++;
                  }
              }
  
              Console.WriteLine(holidaysCount);
          }
      }
  }
  </code></pre>
  
  <p>I am having troubles finding why iIcan't assign a value to the <code>var date</code> in the loop. Therefore the <em>loop goes infinite</em>. N00b</p>