© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•15mo ago•
36 replies
Kenjo

✅ I can't understand

int[] array1 = new int[4];
array1[0] = 1;
array1[1] = 4;
array1[2] = 8;
array1[3] = 3;

int[] array2 = new int[4];
array2[0] = 4;
array2[1] = 12;
array2[2] = 7;
array2[3] = 4;

int[] array3 = new int[3];


for (int i = 0; i < array1.Length; i++)
{
array3[i] = array1[i] + array2[array2.Length - 1 - i];
Console.WriteLine(array3[i]);
}

i was given assignment and this for function is basically the answer that i couldnt do and made chatgpt make it, can someone explain to me how does the code inside for function work? (i was assigned to make for function sum up the first and last, second and third, etc element of array1 and array2)
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

I can't understand
C#CC# / help
3y ago
✅ I don't understand GC
C#CC# / help
4y ago
✅ Complier Error CS0120, Can't understand why I can't call this private field
C#CC# / help
3y ago