<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Rust-Programming-Language%2FC2%2FArrays%2FEnglish</id>
		<title>Rust-Programming-Language/C2/Arrays/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Rust-Programming-Language%2FC2%2FArrays%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Rust-Programming-Language/C2/Arrays/English&amp;action=history"/>
		<updated>2026-05-03T14:47:12Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Rust-Programming-Language/C2/Arrays/English&amp;diff=57117&amp;oldid=prev</id>
		<title>Madhurig at 05:41, 12 September 2025</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Rust-Programming-Language/C2/Arrays/English&amp;diff=57117&amp;oldid=prev"/>
				<updated>2025-09-12T05:41:32Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 05:41, 12 September 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Code Files'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Code Files'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*'''arraysdemo.rs'''&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The following code file is required to practise this tutorial.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The following code file is required to practise this tutorial.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;*'''arraysdemo.rs'''&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* This file is provided in the '''Code Files''' link of this tutorial page.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* This file is provided in the '''Code Files''' link of this tutorial page.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 65:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 67:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''In the menu bar, File &amp;gt;&amp;gt; Open folder &amp;gt;&amp;gt; Desktop &amp;gt;&amp;gt; MyRustProject &amp;gt;&amp;gt; arraysdemo'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''In the menu bar, File &amp;gt;&amp;gt; Open folder &amp;gt;&amp;gt; Desktop &amp;gt;&amp;gt; MyRustProject &amp;gt;&amp;gt; arraysdemo'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Let us go to our working directory '''MyRustProject''' as explained earlier.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Let us go to our working directory '''MyRustProject''' as explained earlier.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 73:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 76:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Point to the '''main.rs''' file.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Point to the '''main.rs''' file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In the '''main.rs '''file, copy and paste the code from the Code file.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In the '''main.rs '''file, copy and paste the code from the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;Code file&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| fn main(){&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| fn main(){&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 88:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Press Ctrl+s&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Press Ctrl+s&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| We have declared an array with variable name as '''arr''' and its data type as '''i32''' and size as &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;4.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| We have declared an array with variable name as '''arr''' and its data type as '''i32''' and size as &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;4. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The values within the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;square brackets&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/del&gt;are '''array values'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The values within the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;square brackets &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;are '''array values'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In Rust, an array can store values of any '''datatype'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In Rust, an array can store values of any '''datatype'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To display the value of the '''nth index''' in an '''array, '''we need to pass the '''index.'''Please note that the '''array index''' starts from 0.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To display the value of the '''nth index''' in an '''array, '''we need to pass the '''index.'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Please note that the '''array index''' starts from 0.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Save the program. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Save the program. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 120:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 125:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let us try to access a value greater than 4, say 6th element where there is no value.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let us try to access a value greater than 4, say 6th element where there is no value.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Add the '''println''' statement as shown.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Add the '''println''' statement as shown. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Save the file.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Save the file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Point to the error&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Point to the error&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In the terminal, type '''cargo run'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In the terminal, type '''cargo run'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We see an error- index out of bounds.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We see an error- &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;index out of bounds&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So, arrays in Rust are different as compared to other programming languages.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So, arrays in Rust are different as compared to other programming languages.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 153:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 159:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Clear the window and copy and paste the code from the Code &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;file&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Clear the window and copy and paste the code from the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;Code &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;fil'''e&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We have declared an array of '''colors '''with '''mut'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We have declared an array of '''colors '''with '''mut'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here the data type and size of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/del&gt;array are specified.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here the data type and size of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;array are specified.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;amp;nbsp;We have assigned a new value as “'''green'''” to the third element in the array.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;amp;nbsp;We have assigned a new value as “'''green'''” to the third element in the array.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 175:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 181:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Next let us see some powerful methods used to unlock the full potential of arrays.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Next let us see some powerful methods used to unlock the full potential of arrays.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Clear the window and copy and paste the code from the code files.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Clear the window and copy and paste the code from the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;code files&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| fn main() {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| fn main() {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 198:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 204:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||&amp;#160; Let us see the different methods used in arrays.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||&amp;#160; Let us see the different methods used in arrays.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''is_empty() '''method checks if the array has any''' elements'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''is_empty() ''' method checks if the array has any''' elements'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here, '''arr''' has 4 elements, so the result is '''false'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here, '''arr''' has 4 elements, so the result is '''false'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We can access an element using the '''.get() '''method.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We can access an element using the '''.get() ''' method.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It takes the index value as the parameter.&amp;amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It takes the index value as the parameter.&amp;amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 208:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 214:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The '''get''' method returns an '''Option enum'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The '''get''' method returns an '''Option enum'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;.'''get(1) '''returns an '''Option&amp;lt;i32&amp;gt; '''with the value at index 1 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(&lt;/del&gt;which is 2&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;.'''get(1) '''returns an '''Option&amp;lt;i32&amp;gt; '''with the value at index 1&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;,&amp;#160; &lt;/ins&gt;which is 2.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;.unwrap() extracts the value (2) from '''Some'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;.unwrap() extracts the value (2) from '''Some'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Likewise,.first() returns Some(1) that is the first element.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Likewise,&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;.first()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;returns &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;Some(1)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;that is the first element.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;.unwrap() extracts 1 from Some(1).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;.unwrap()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;extracts 1 from &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;Some(1)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;.last() returns the last element as 4 &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;.last()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;returns the last element as 4 &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;.split_at(2) splits the array at index 2, producing two slices:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;.split_at(2) splits the array at index 2, producing two slices:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 225:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 231:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In the terminal, type '''cargo run'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In the terminal, type '''cargo run'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In the terminal, type '''cargo run'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In the terminal, type '''cargo run'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 245:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 250:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Assignment'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Assignment'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[10, 20, 30, 40, 50, 60]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| As an Assignment, please do the following:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| As an Assignment, please do the following:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Declare an array of 6 integers&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;: [10, 20, 30, 40, 50, 60]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Declare an array of 6 integers&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Use a loop to print all elements in the array&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Use a loop to print all elements in the array&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Create a slice of the array from index 2 to 4 &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Create a slice of the array from index 2 to 4 &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Madhurig</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Rust-Programming-Language/C2/Arrays/English&amp;diff=57116&amp;oldid=prev</id>
		<title>Madhurig at 05:19, 12 September 2025</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Rust-Programming-Language/C2/Arrays/English&amp;diff=57116&amp;oldid=prev"/>
				<updated>2025-09-12T05:19:47Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=Rust-Programming-Language/C2/Arrays/English&amp;amp;diff=57116&amp;amp;oldid=57102&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Madhurig</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Rust-Programming-Language/C2/Arrays/English&amp;diff=57102&amp;oldid=prev</id>
		<title>Nirmala Venkat: Created page with &quot;{| border=&quot;1&quot; |- || '''Visual Cue''' || '''Narration''' |-  || '''Slide 1''' || &lt;span style=&quot;color:#000000;&quot;&gt;Welcome to the Spoken Tutorial on &lt;/span&gt;&lt;span style=&quot;color:#00000...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Rust-Programming-Language/C2/Arrays/English&amp;diff=57102&amp;oldid=prev"/>
				<updated>2025-09-03T09:40:21Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| border=&amp;quot;1&amp;quot; |- || &amp;#039;&amp;#039;&amp;#039;Visual Cue&amp;#039;&amp;#039;&amp;#039; || &amp;#039;&amp;#039;&amp;#039;Narration&amp;#039;&amp;#039;&amp;#039; |-  || &amp;#039;&amp;#039;&amp;#039;Slide 1&amp;#039;&amp;#039;&amp;#039; || &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Welcome to the Spoken Tutorial on &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#00000...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|| '''Visual Cue'''&lt;br /&gt;
|| '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|| '''Slide 1'''&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Welcome to the Spoken Tutorial on &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Arrays in Rust.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Slide 2'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Learning Objectives'''&amp;lt;/div&amp;gt;&lt;br /&gt;
|| In this tutorial, we will learn about:&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Arrays&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.118cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Slide 3'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''System Requirements'''&amp;lt;/div&amp;gt;&lt;br /&gt;
|| To record this tutorial I am using:&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Ubuntu Linux OS version 22.04&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Rust version 1.80.0 &amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Visual Studio Code version 1.19.0&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.118cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Slide 4'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Prerequisites'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;color:#000000;&amp;quot; | To follow this tutorial, you should be familiar with compiling and running Rust programs.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.118cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Slide'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''5'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Code Files'''&amp;lt;/div&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;The following code file is required to practise this tutorial.&amp;lt;/div&amp;gt;&lt;br /&gt;
*'''arraysdemo.rs'''&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;This file is provided in the '''Code Files''' link of this tutorial page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.118cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Slide 6'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Arrays'''&amp;lt;/div&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''Arrays''' in '''Rust''' are collections of values of the same data type and have a fixed size&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Arrays once initialized cannot be resized&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;An array declaration allocates sequential memory blocks&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.118cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#000000;&amp;quot; | &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Let us understand how arrays &amp;lt;/span&amp;gt;work&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; in a&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;''' &amp;lt;/span&amp;gt;R&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;ust'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; program.&amp;lt;/span&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Open &amp;lt;/span&amp;gt;'''Visual Studio Code editor.'''&lt;br /&gt;
&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Open the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Visual &amp;lt;/span&amp;gt;S&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;tudio &amp;lt;/span&amp;gt;C&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;ode editor.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;In the menu bar, click on &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Terminal'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; and select&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;''' New Terminal'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;In the menu bar, click on &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Terminal'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; and select&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;''' New Terminal'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''&amp;gt; cd'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Desktop'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''MyRustProject'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''&amp;gt;'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''cargo new &amp;lt;/span&amp;gt;arraysdemo'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''In the menu bar, File &amp;gt;&amp;gt; Open folder &amp;gt;&amp;gt; Desktop &amp;gt;&amp;gt; MyRustProject &amp;gt;&amp;gt; arraysdemo'''&amp;lt;/div&amp;gt;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Let us go to our working directory &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''MyRustProject'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; as explained earlier.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Type the command &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''cargo new arraysdemo '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;and press &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Enter.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Open the created project as shown.&amp;lt;/div&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Point to the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''main.rs'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; file.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;In the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;'''main.rs '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;file, copy and paste the code from the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;ode file.&amp;lt;/span&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;fn main(){&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;let arr:[i32;4] = [10,20,30,40];&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;println!(&amp;quot;First element: {}&amp;quot;,arr[0]);&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;println!(&amp;quot;Second element: {}&amp;quot;, arr[1]);&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;println!(&amp;quot;array size is :{}&amp;quot;,arr.len());&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Press Ctrl+s&amp;lt;/div&amp;gt;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;We have declared an array with variable name as '''arr''' and its data type as '''i32''' and size as '''4.'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;The values &amp;lt;/span&amp;gt;within&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''square brackets'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; are &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''array values'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Rust, an array can store values of any '''datatype'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;To display the value of the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;'''nth index'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt; in an &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;'''array, '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;we need to pass the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;'''index.'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;Please note that the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;'''array index'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt; starts from 0.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Save the program. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Let us execute the code and see the output.&amp;lt;/div&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Click on terminal and select &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''New Terminal.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;In the terminal, type &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''cargo run'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Point to the output.&amp;lt;/div&amp;gt;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;In the menu bar, click on &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Terminal'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; and select &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''New Terminal.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;In the terminal, type &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''cargo run'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;It prints the first element as 10, second element as 20&amp;lt;/span&amp;gt; and array size as 4.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#252525;&amp;quot;&amp;gt;println!(&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;quot;array is {:?}&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#252525;&amp;quot;&amp;gt;, arr[5]);&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Press Ctrl+s&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Let us modify the code as shown.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;We have 4 values in the array.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Let us try to access a value greater than 4, say 6th element where there is no value.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Add the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''println'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; statement as shown.&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Save the file.&amp;lt;/div&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &lt;br /&gt;
&lt;br /&gt;
Point to the error&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;In the terminal, type &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''cargo run'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;We see an error- index out of bounds&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;So, arrays in Rust are different as compared to other programming languages.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Th&amp;lt;/span&amp;gt;is&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; is because they have a fixed length.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#000000;&amp;quot; | &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Next let us see an example of &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''mutable Array'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; in Rust.&amp;lt;/span&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Delete the existing code.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
f&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;n main(){&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;// an array with data type and size&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;let mut colors: [&amp;amp;str; 3] = [&amp;quot;black&amp;quot;, &amp;quot;blue&amp;quot;, &amp;quot;red&amp;quot;];&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;println!(&amp;quot;Original colors: {:?}&amp;quot;, colors);&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;// change the value of the 3rd element in the array&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;colors[2] = &amp;quot;green&amp;quot;;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;println!(&amp;quot;changed colors = {:?}&amp;quot;, colors);&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;}&amp;lt;/div&amp;gt;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Clear the window and copy and paste the code from the Code file.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;We have declared an array of &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''colors '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;with &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''mut'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here the data type and size of the array are specified&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;W&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;e have assigned a new value as “&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''green'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;” to the third element in the array.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;As &amp;lt;/span&amp;gt;the&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;created array&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;i&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;s mutable, it is possible to change the value.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Save the file.&amp;lt;/div&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Point to the output&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;In the terminal, type &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''cargo run'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; and see the output.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output shows the Original colors as black, blue, red.&lt;br /&gt;
&lt;br /&gt;
And the changed &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;color values&amp;lt;/span&amp;gt; as black, blue, green.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#000000;&amp;quot; | &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Next let us see some &amp;lt;/span&amp;gt;p&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;owerful methods used to unlock the full potential of arrays.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Clear the window and copy and paste the code from the code files.&amp;lt;/div&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;fn main() {&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;let arr = [1, 2, 3, 4];&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;// Output: Is empty: false&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;println!(&amp;quot;Is empty: {}&amp;quot;, arr.is_empty()); &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;println!(&amp;quot;2nd element: {}&amp;quot;, arr.get(1).unwrap()); // 2&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;println!(&amp;quot;First element: {}&amp;quot;, arr.first().unwrap()); // 1&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;println!(&amp;quot;Last element: {}&amp;quot;, arr.last().unwrap()); // 4&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;let (left, right) = arr.split_at(2);&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;println!(&amp;quot;Left slice:{:?}, Right slice:{:?}&amp;quot;, left, right);&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;}&amp;lt;/div&amp;gt;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Let us see the different methods used in arrays.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;'''is_empty() '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;method &amp;lt;/span&amp;gt;checks if the array has&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;any&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;''' elements'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Here, &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''arr'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; has 4 elements, so the result is &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''false'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can access an element using the '''.get() '''method.&lt;br /&gt;
&lt;br /&gt;
It takes the index value as the parameter.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
The '''get''' method returns an '''Option enum'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;'''get(1) '''returns an '''Option&amp;lt;i32&amp;gt; '''with the value at index 1 (which is 2).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;.unwrap() extracts the value (2) from &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Some'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;Likewise,.&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:transparent;color:#188038;&amp;quot;&amp;gt;first()&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:transparent;color:#434343;&amp;quot;&amp;gt; r&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;eturns &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;Some(1)&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;that is &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;the first element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;.unwrap()&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt; extracts &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt; from &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;Some(1)&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;.last()&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt; returns the last element as 4 &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;.split_at(2)&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt; splits the array at index &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;, producing two slices:&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;left&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt; contains the first two elements: &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;that is&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;[1, 2]&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;right&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt; contains the remaining elements: &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt;that is&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#434343;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#188038;&amp;quot;&amp;gt;[3, 4]&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Save the program.&amp;lt;/div&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;In the terminal, type &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''cargo run'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;In the terminal, type &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''cargo run'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;We can see the left slice and right slice output.&amp;lt;/div&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Slide 7'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Summary'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;In this tutorial, we learn about&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Arrays'''&amp;lt;/div&amp;gt;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;This brings us to the end of this tutorial.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Let us summarize. &amp;lt;/div&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Slide 8'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Assignment'''&amp;lt;/div&amp;gt;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;As an Assignment, please do the following:&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Declare an array of 6 integers: [10, 20, 30, 40, 50, 60]&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Use a loop to print all elements in the array&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Create a slice of the array from index 2 to 4 &amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;color:#000000;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Print the slice using {:?}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#000000;&amp;quot; | '''Slide 9 Thank You'''&lt;br /&gt;
| style=&amp;quot;color:#000000;&amp;quot; | Thank you for joining.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:-1.588cm;margin-right:-1.429cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nirmala Venkat</name></author>	</entry>

	</feed>