Click here to Skip to main content
15,891,687 members

Comments by CoderL18 (Top 5 by date)

CoderL18 4-Oct-21 8:18am View    
I have my code to calculate the sum of the first and last in the array. My only problem is that I don't know how to make my loop to keep running until I only have two numbers like this. I am trying to do it without putting my code in another method.

• 22211111112
o 4
• 22211111112
o 43
• 22211111112
o 433
• 22211111112
o 4332
• 22211111112
o 43322
• 22211111112
o 433221
• 433221
o 5
• 433221
o 55
• 433221
o 555
• 555
o 10
• 555
o 105
• 105
o 6
• 105
o 60
CoderL18 4-Oct-21 5:30am View    
You don't have to be so rude !, We all are still learning and we all make mistakes, nobody is prefect.
CoderL18 4-Oct-21 5:29am View    
Oh yes I forgot I had initialized it to 100 instead of 1. Thank you so much!.
CoderL18 4-Oct-21 5:14am View    
I have tried that but then it points to the "in" in the foreach and gives me this error: An unhandled exception of type 'System.NullReferenceException' occurred in GoodMatch.exe

Additional information: Object reference not set to an instance of an object.
CoderL18 4-Oct-21 5:05am View    
It points to s.ToArray() -> And shows this: An unhandled exception of type 'System.ArgumentNullException' occurred in System.Core.dll

Additional information: Value cannot be null.