I'm new to programming and they gave me this program for homework, but I have no idea how to solve it. I had heard about the bubble method, but I don't know how to implement it in the algorithm, could someone guide me?
I'm new to programming and they gave me this program for homework, but I have no idea how to solve it. I had heard about the bubble method, but I don't know how to implement it in the algorithm, could someone guide me?
I hope this helps:
Although this answer is already answered, I contribute my grain of sand:
option 1: simplification of the other proposed solution
option 2: using bitset
If you want to just print it, I recommend that you use the following recursive algorithm that not only converts you from decimal to binary, but to any base. If the base is greater than 10 you would have to do a couple of tweaks but it is minimal. There it goes:
this is the way i do it