Hi All, I have been asked to create a trace table from the following piece of Code:
I have been researching this for a while but i still don't understand how i can create a trace table with this code. I have been given what values to run through "starting with DecimalNumber equal to 7 and again with DecimalNumber equal to 254. "
Then suggest any code changes...
If anyone could help me it would be greatly appreciated.
Thanks,
Iceman911
Code:
Value = 1
Do While DecimalNumber <> 0
Digit = (DecimalNumber Mod 2) ‘= Number DIVIDE Number
BinaryNumber = BinaryNumber & Digit
DecimalNumber = DecimalNumber \ 2
Value = Value * 2
Loop
Output BinaryNumber
Then suggest any code changes...
If anyone could help me it would be greatly appreciated.
Thanks,
Iceman911
Last edited: