© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
7 replies
Blake

❔ Array confusion..

I'm trying to figure out how to choose a set amount of values from an array without using all the values in it at once.
for example if I have
int[] X = new int[] { 1, 2, 3, 4, 5, 6, 7};
and I wanted to get the sum of only the first 5 values in the array, how do I do that?
hopefully I explained it well enough cuz I wasn't able to put my problem into the correct words and find the answer through google lol...
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

✅ Equality confusion
C#CC# / help
4mo ago
✅ Serilog Confusion
C#CC# / help
11mo ago
Attributes confusion
C#CC# / help
2y ago
Dotnet / Javascript confusion
C#CC# / help
2y ago