© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
14 replies
jadders

❔ Coin sorting issue

Hey guys, I'm building a little test app that gives you the smallest amount of coins that you can use to make a specific value. Here is the program running, and here is my code

I'm having an issue, where when it gets to a certain number, it's breaking. Do I need to use Ceiling or Floor in the code? I just find it weird as I swear I built this exact same program with roughly the same code in Uni and it worked?

Every if/else if statement is the same as these, and then it prints out the coins, but due to the weird issue, it never gets to 0. I guess I could add an if statement to check if it is less than 0.01

Thank you
image.png
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

✅ Bubbel sorting
C#CC# / help
11mo ago
✅ Leaderboard Sorting
C#CC# / help
13mo ago
Sorting Help.
C#CC# / help
3y ago
✅ Sorting nested
C#CC# / help
4y ago