Decimal to HexaDecimal

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 24
Reputation: Behi Jon is an unknown quantity at this point 
Solved Threads: 0
Behi Jon Behi Jon is offline Offline
Newbie Poster

Decimal to HexaDecimal

 
0
  #1
Sep 7th, 2009
Hi ...
Is there a way to write a program in c++ that get a decimal number and convert it to its equivalent in hexadecimal without using arrays ?
A bit guidance please ....
Thanks ...
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,696
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 728
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Decimal to HexaDecimal

 
2
  #2
Sep 7th, 2009
>Is there a way to write a program in c++ that get a decimal number
>and convert it to its equivalent in hexadecimal without using arrays ?

Why yes, there is indeed a way.

>A bit guidance please ....
I'm guessing that you refused to search the forum before posting a new thread, because I can guarantee that this question has been asked and answered at least half a million times since Daniweb went live.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Decimal to HexaDecimal

 
0
  #3
Sep 8th, 2009
> asked and answered at least half a million times since Daniweb went live.
For the millionth time, stop exaggerating
Originally Posted by daniweb stats
DaniWeb IT Discussion Community Statistics

Threads: 199,393, Posts: 951,087, Members: 601,466, Active Members: 85,978
> Why yes, there is indeed a way.
Where there is a will, there is a way.
As in
"Will you do my homework" - "no way!"
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 919
Reputation: DdoubleD is a jewel in the rough DdoubleD is a jewel in the rough DdoubleD is a jewel in the rough DdoubleD is a jewel in the rough 
Solved Threads: 147
DdoubleD DdoubleD is offline Offline
Posting Shark

Re: Decimal to HexaDecimal

 
0
  #4
Sep 8th, 2009
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 24
Reputation: Behi Jon is an unknown quantity at this point 
Solved Threads: 0
Behi Jon Behi Jon is offline Offline
Newbie Poster

Re: Decimal to HexaDecimal

 
0
  #5
Sep 8th, 2009
Originally Posted by Narue View Post
I'm guessing that you refused to search the forum before posting a new thread, because I can guarantee that this question has been asked and answered at least half a million times since Daniweb went live.
Oh... you're right . My search results, show me that I can use recursive function . But is there another way ? I don't want the code; Just a guidance like this : You can use recursive functions
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,864
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 301
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Roasting Maven

Re: Decimal to HexaDecimal

 
0
  #6
Sep 8th, 2009
Originally Posted by Behi Jon View Post
I don't want the code; Just a guidance like this : You can use recursive functions
Ok. --> You can use recursive functions

Also: Loops.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 24
Reputation: Behi Jon is an unknown quantity at this point 
Solved Threads: 0
Behi Jon Behi Jon is offline Offline
Newbie Poster

Re: Decimal to HexaDecimal

 
0
  #7
Sep 8th, 2009
Originally Posted by niek_e View Post
Ok. --> You can use recursive functions

Also: Loops.

Are you sure that loops can be useful ? I don't want to use anything further than this operators : / , % and cout , cin . Do you have tried it ? We have 'A' to 'F' letters also . It make the way a bit hard . I think so .
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,864
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 301
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Roasting Maven

Re: Decimal to HexaDecimal

 
0
  #8
Sep 8th, 2009
if you just want to display the number, you could use:
cout << hex << 15;
output: f
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 24
Reputation: Behi Jon is an unknown quantity at this point 
Solved Threads: 0
Behi Jon Behi Jon is offline Offline
Newbie Poster

Re: Decimal to HexaDecimal

 
0
  #9
Sep 8th, 2009
Originally Posted by niek_e View Post
if you just want to display the number, you could use:
cout << hex << 15;
output: f
No my friend . If I just want to display the number, I could use arrays simply .
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,864
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 301
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Roasting Maven

Re: Decimal to HexaDecimal

 
0
  #10
Sep 8th, 2009
Originally Posted by Behi Jon View Post
No my friend . If I just want to display the number, I could use arrays simply .
Aha (?)
So perhaps you should tell us what your input is, and what your output should be so I can stop wasting my time giving you suggestion you apparently don't want.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC