title: Convert seconds to Days, Minutes and Seconds
body: <p>Hey everyone. I've continuing to learn C++ and I've been set the 'challenge' of converting seconds to format as the Days,Minutes and Seconds.</p>
  
  <p>For example: 31600000 = 365 days, 46 minutes, 40 seconds.</p>
  
  <pre><code>using namespace std;
  const int hours_in_day = 24;
  const int mins_in_hour = 60;
  const int secs_to_min = 60;
  
  long input_seconds;
  cin &gt;&gt; input_seconds;
  
  long seconds = input_seconds % secs_to_min;
  long minutes = input_seconds / secs_to_min % mins_in_hour;
  long days = input_seconds / secs_to_min / mins_in_hour / hours_in_day;
  
  cout &lt;&lt; input_seconds &lt;&lt; " seconds = "
       &lt;&lt; days &lt;&lt; " days, "
       &lt;&lt; minutes &lt;&lt; " minutes, "
       &lt;&lt; seconds &lt;&lt; " seconds ";
  
  return 0;
  </code></pre>
  
  <p>It works and comes up with the correct answer but after completing it I looked at how other people had tackled it and theirs was different. I'm wondering If I'm missing something.</p>
  
  <p>Thanks, Dan.</p>