Flowcharting (Iteration Structure)
Write an algorithm and draw a flowchart that will convert a given decimal number (N10) to its equivalent binary number (N2).
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
Comments
Leave a comment