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 ...

Recommended Answers

All 9 Replies

>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.

> asked and answered at least half a million times since Daniweb went live.
For the millionth time, stop exaggerating ;)

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!"

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

I don't want the code; Just a guidance like this : You can use recursive functions

Ok. --> You can use recursive functions

Also: Loops.

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 .

if you just want to display the number, you could use: cout << hex << 15; output: f

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 .

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.