# নিচের সমস্যার অ্যালগরিদম কেমন হবে?

 0 `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.` ```Sample Input Sample Output 1 0 0                18 2 1 0 -1 0 1 0               21 2 1 0 1 -1 ``` asked 05 May '18, 18:02 beginner level 39●4 Can you please provide the question link? Can't understand your problem for bad formatting. NB: You shouldn't just ask for a homework / problem solution in the forum. These are for you to solve. You can ask for a specific problem if you are really stuck. (06 May '18, 06:22) Ashfaqur Rahman

 0 ``````#1. int i=0, dec=0, count=0; #2. input number, then i=i*10+input (until number < 0) & sum++ #3. for_loop cheking all digit of i (last to first) dec = dec + digit * pow(2, sum-1); sum-- #4. count how many digit in dec #5. print `````` answered 06 May '18, 17:38 alamarif 11●1
 toggle preview community wiki:

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Question tags:

×70

question asked: 05 May '18, 18:02

question was seen: 405 times

last updated: 07 May '18, 10:58