943,514 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 4008
  • C++ RSS
Sep 7th, 2009
0

Decimal to HexaDecimal

Expand Post »
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 ...
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
Behi Jon is offline Offline
47 posts
since Nov 2008
Sep 7th, 2009
2

Re: Decimal to HexaDecimal

>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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Sep 8th, 2009
0

Re: Decimal to HexaDecimal

> asked and answered at least half a million times since Daniweb went live.
For the millionth time, stop exaggerating
Quote 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!"
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005
Sep 8th, 2009
0

Re: Decimal to HexaDecimal

Reputation Points: 341
Solved Threads: 233
Posting Shark
DdoubleD is offline Offline
984 posts
since Jul 2009
Sep 8th, 2009
0

Re: Decimal to HexaDecimal

Click to Expand / Collapse  Quote originally posted by Narue ...
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
Reputation Points: 10
Solved Threads: 1
Light Poster
Behi Jon is offline Offline
47 posts
since Nov 2008
Sep 8th, 2009
0

Re: Decimal to HexaDecimal

Click to Expand / Collapse  Quote originally posted by Behi Jon ...
I don't want the code; Just a guidance like this : You can use recursive functions
Ok. --> You can use recursive functions

Also: Loops.
Moderator
Featured Poster
Reputation Points: 4142
Solved Threads: 394
Industrious Poster
Nick Evan is offline Offline
4,132 posts
since Oct 2006
Sep 8th, 2009
0

Re: Decimal to HexaDecimal

Click to Expand / Collapse  Quote originally posted by niek_e ...
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 .
Reputation Points: 10
Solved Threads: 1
Light Poster
Behi Jon is offline Offline
47 posts
since Nov 2008
Sep 8th, 2009
0

Re: Decimal to HexaDecimal

if you just want to display the number, you could use:
cout << hex << 15;
output: f
Moderator
Featured Poster
Reputation Points: 4142
Solved Threads: 394
Industrious Poster
Nick Evan is offline Offline
4,132 posts
since Oct 2006
Sep 8th, 2009
0

Re: Decimal to HexaDecimal

Click to Expand / Collapse  Quote originally posted by niek_e ...
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 .
Reputation Points: 10
Solved Threads: 1
Light Poster
Behi Jon is offline Offline
47 posts
since Nov 2008
Sep 8th, 2009
0

Re: Decimal to HexaDecimal

Click to Expand / Collapse  Quote originally posted by Behi Jon ...
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.
Moderator
Featured Poster
Reputation Points: 4142
Solved Threads: 394
Industrious Poster
Nick Evan is offline Offline
4,132 posts
since Oct 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Enquiries about Bitwise operators
Next Thread in C++ Forum Timeline: i ned a small help[maybe a litttle big]





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC