Write a function int_to_binary that converts an integer to a character string that
is the binary representation of the integer. Adjust the 1s and 0s in the right-hand
portion of the string and pad the remainder of the string with blanks. The string
should contain no insignificant zeros, except that the integer 0 should produce the
string consisting of all blanks and one character “0”. If the integer is negative, the
first nonblank character should be a minus sign; if it is positive, the first nonblank
character should be ”1”. Declare the function result to have length 5. If the declared length is not long enough to contain the result, it should consist of all asterisks.
You should write the function in such a way that changing the length of the function result to 16 requires no additional changes in the function.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here