Question: HELP ASAP! I need to submit this program right now, but its not properly running. I need to have no leading zeros as an output
HELP ASAP! I need to submit this program right now, but its not properly running. I need to have no leading zeros as an output after 0b. Except it is okay when I do 0x0 output 0b0. For instance, I should get 0x7d output 0b1111101 and it should not output 0b01111101. When you input 0x3E its output should be 0b111110 and not 0b00111110. When I input 0x1f I should get 0b11111. When making changes make sure that you always have 0x0 to output 0b0. Please help!
#include if (value == "0000") { value = "0"; } value = "0b" + value; cout << "Your number in binary is " << value; cout << "." << endl; } return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
