All public logs
From Applied Science
Combined display of all available logs of Applied Science. You can narrow down the view by selecting a log type, the username (case-sensitive), or the affected page (also case-sensitive).
- 12:17, 22 April 2022 0kelvin talk contribs created page Commented exercises (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...")