<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Exercise 1 of Lesson 4 contains some redundant code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119154/exercise-1-of-lesson-4-contains-some-redundant-code</link><description>https://github.com/NordicDeveloperAcademy/ncs-fund/blob/main/v2.9.0-v2.7.0/l4/l4_e1_sol/src/main.c 
 The current logic uses i and j to calculate factorial. 
 
 for (i = 1; i &amp;lt;= MAX_NUMBER_FACT; i++) {
 factorial = 1;
 for (j = 1; j &amp;lt;= i; j++) {
 factorial</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Feb 2025 12:19:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119154/exercise-1-of-lesson-4-contains-some-redundant-code" /><item><title>RE: Exercise 1 of Lesson 4 contains some redundant code</title><link>https://devzone.nordicsemi.com/thread/524073?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 12:19:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:805b1bf0-fef8-4fc1-98f2-61ec89f7b286</guid><dc:creator>Rick Cai</dc:creator><description>&lt;p&gt;Thanks for the info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Exercise 1 of Lesson 4 contains some redundant code</title><link>https://devzone.nordicsemi.com/thread/524064?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 11:26:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fef9657b-8bfd-4a11-acf1-fe0de9f94aad</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We have now updated both the course and the code solution.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Exercise 1 of Lesson 4 contains some redundant code</title><link>https://devzone.nordicsemi.com/thread/523936?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 14:57:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc00c18e-7b25-4d47-a9c5-d2fa59dab658</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are of course correct. The code could be shortened the way you describe, since the variable j is not really needed. Thank you for bringing this to our attention.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>