Question: usage 1/2 binGen.cpp This program will ask the user the number of bits needed (let us say that value goes into the variable N). The



usage 1/2 binGen.cpp This program will ask the user the number of bits needed (let us say that value goes into the variable "N"). The program will then generate ALL POSSIBLE "N"-bit BINARIES. For example, if the user enters 3 at the input prompt, the program would then generate: 001 010 011 100 101 110 Those are all 8 possibilities using 3 bits. Note that (and this will be a challenge) when the numbers are printed out, they are ALWAYS in forms of "N" bits (in this case N 3), that is, you will need to PAD your printed numbers with enough "O's on the left to always maintain "N" bits. See example print out: $./binGen How many bits to generate? 2 The decimal number 0 is 00 The decimal number is 01 The decimal number 2 is 10 The decimal number 3 is 11 ? -/binGen
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
