1. Continually take input unless a negative number is given. Input will be only 0/1. That is actually binary representation of a number. You have to determine the decimal representation and total number of digits in decimal representation of that number. Input order MSB to LSB. You CANNOT use array for this.