© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
16 replies
js

max function in arrays

i am writing a program to output change for a vending machine in the minimum amount of coins. I want a way to select the corrent number from the array which is closest to the change value which is inputted for example: input 65, the closest value would be 50. I am sorry if my code is bad im really new
image.png
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

Help with Arrays, including parallel arrays and split function
C#CC# / help
2y ago
✅ arrays
C#CC# / help
3mo ago
Arrays
C#CC# / help
4y ago
Arrays of floats in stack
C#CC# / help
13mo ago