Erev0s
05-03-04, 06:44 PM
Hi i want to convert a decimal number to a hex with this recursive function
I have a problem:
ie: (205)10=(CD)16
i have a problem with my code it'doesnt print the correct answer :)
plz help
void DecToHex (long dec_numb)
{
new_numb=dec_numb;
dec_numb%=16;
new_numb/=16;
if(new_numb>0){
DecToInt(new_numb);
}
printf("%lX",dec_numb);
}
I have a problem:
ie: (205)10=(CD)16
i have a problem with my code it'doesnt print the correct answer :)
plz help
void DecToHex (long dec_numb)
{
new_numb=dec_numb;
dec_numb%=16;
new_numb/=16;
if(new_numb>0){
DecToInt(new_numb);
}
printf("%lX",dec_numb);
}