Calculating the date from day-number?
<p>How would one go about calculating a date from a day-number in C++? I don't require you to write the whole code, I just can't figure out the maths to calculate the month and the day-of-month!</p>

<p>Example:</p>

<pre><code>input: 1
output: 01/01/2012

input: 10
output: 01/10/2012

input: 365
output: 12/31/2012
</code></pre>

<p>It would always use the current year, if they exceeded 365, I would return 0. There is no need for a leap-year detection.</p>
