Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
ඔයාගෙ Assignment හෝ Thesis එක හරියට හදාගමු
ErMurazor
Updated:
Saturday at 10:52 PM
Ad icon
BlackWall V2ray servers
hu KANNA
Updated:
Wednesday at 4:58 AM
Peppa Pig Family Plush Toy Set – 5 Characters
anil1961
Updated:
Sep 19, 2026
Ad icon
Express VPN PC - 1 Year Rs. 600.00
Sanathbh
Updated:
Sep 19, 2026
Ad icon
Capcut Pro 7 Days Team Plan - Rs. 3️⃣0️⃣0️⃣
Sanathbh
Updated:
Sep 19, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Software Development
Programming - Bug එක සොයන්න
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Dilan Pro" data-source="post: 28425034" data-attributes="member: 582421"><p>Based on the code you provided, there are several syntax errors and issues with variable assignments. Here is a corrected version of the code that should fix the issues you mentioned</p><p></p><p>[ICODE]</p><p>static void Main(string[] args) {</p><p> var numbers = new List<int>() { 1, 2, 3, 4 };</p><p> numbers.Add(1);</p><p> numbers.AddRange(new int[3] { 5, 6, 7 });</p><p></p><p> foreach (var number in numbers)</p><p> Console.WriteLine(number);</p><p></p><p> Console.WriteLine();</p><p> Console.WriteLine("Index of 1: " + numbers.IndexOf(1));</p><p> Console.WriteLine("Last Index of 1: " + numbers.LastIndexOf(1));</p><p> Console.WriteLine("Count: " + numbers.Count);</p><p></p><p> for (var i = 0; i < numbers.Count; i++) {</p><p> if (numbers[i] == 1)</p><p> numbers.Remove(numbers[i]);</p><p> }</p><p></p><p> foreach (var number in numbers)</p><p> Console.WriteLine(number);</p><p>}</p><p></p><p>[/ICODE]</p><p></p><p>In the original code, there were several issues with the syntax, including missing semicolons, incorrect use of the var keyword, and incorrect use of the List class. I have corrected these issues in the revised code. Additionally, the for loop that removes all occurrences of the number 1 from the list was not functioning properly in the original code, so I have rewritten that section to remove the number 1 from the list as intended.</p></blockquote><p></p>
[QUOTE="Dilan Pro, post: 28425034, member: 582421"] Based on the code you provided, there are several syntax errors and issues with variable assignments. Here is a corrected version of the code that should fix the issues you mentioned [ICODE] static void Main(string[] args) { var numbers = new List<int>() { 1, 2, 3, 4 }; numbers.Add(1); numbers.AddRange(new int[3] { 5, 6, 7 }); foreach (var number in numbers) Console.WriteLine(number); Console.WriteLine(); Console.WriteLine("Index of 1: " + numbers.IndexOf(1)); Console.WriteLine("Last Index of 1: " + numbers.LastIndexOf(1)); Console.WriteLine("Count: " + numbers.Count); for (var i = 0; i < numbers.Count; i++) { if (numbers[i] == 1) numbers.Remove(numbers[i]); } foreach (var number in numbers) Console.WriteLine(number); } [/ICODE] In the original code, there were several issues with the syntax, including missing semicolons, incorrect use of the var keyword, and incorrect use of the List class. I have corrected these issues in the revised code. Additionally, the for loop that removes all occurrences of the number 1 from the list was not functioning properly in the original code, so I have rewritten that section to remove the number 1 from the list as intended. [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom