I have written this code and am finding myself in a never ending loop, i've tried changing the 0 ( eg while num >0 do) to a different number and this stops the loop but i'm still not getting the right calculations... And the answers that are coming out I don't understand where they are coming from, think maybe something to do with using +...
It'd be much appreciated if anyone could help me out here...
user, prop : integer;
procedure DecToHex (Number : integer);
HexValue : string  = '123456789ABCDEF';
HexStr : string;
remainder : integer;
HexStr := '';
while Number > 0 do
Remainder := Number mod 16;
HexStr := HexValue[Remainder + 1] + HexStr;
Number := Number div 16 + 1;
writeln (' please enter number');