Question #262325

Flowcharting (Iteration Structure)

Write an algorithm and draw a flowchart that will convert a given decimal number (N10) to its equivalent binary number (N2).


Expert's answer

Start

Take input ( a decimal number like ‘a ‘)

Start the loop (for (i=0 ;i>1 ;i++))

Apply following calculation inside loop

ar[i]=a%2

a=a/2

Outside loop

ar[i]=a

start loop again for print (for (j=i; j>=0; j—) )

Out ar[j]

End





LATEST TUTORIALS
APPROVED BY CLIENTS