Commented exercises: Revision history

From Applied Science

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

23 January 2025

22 January 2025

28 April 2022

22 April 2022

  • curprev 19:1719:17, 22 April 2022Wikiadmin talk contribs 4,419 bytes +4,419 Created page with "* '''The two algorithms below attempt to calculate xn. However, both are wrong, explain the error in each one:''' <div style="margin-left:1.5em;"> {| class="wikitable" |<div class="code">for (i = 1; i <= n; i++) x = x * i;</div> || It's successively multiplying by an increasing counter. For x = 4, we have 4 * 1 * 2 * ... * n |- |<div class="code">for (i = 0; i < n; i++) x = x * x;</div> || It's squaring the number over and over n times. For x = 4, we have 42, then 162, t..."