I want to write a function that sets multiple bits.
Here is how it should look:
The user gives a positive integer, like 5. It then prints out the binary number
Then the user has to give place number of what bit he wants to set, for instance 6
Then comes the setting part and it should look like this 00000000 00000000 00000000 00100101
I have already done the binary representation of a number.
But I don't know how I display the place I want to set and then actually set the bits.
Can someone help me out?
Here is my code so far: