text: Function to convert Decimal to Hex
code: string convertToHex ( int num ) { string temp = " " ; while ( num != 0 ) { int rem = num % 16 ; char c ; if ( rem < 10 ) { c = rem + 48 ; } else { c = rem + 87 ; } temp += c ; num = num / 16 ; } return temp ; }