# What is gotoxy??

• 11-22-2008
Beachblue
What is gotoxy??
Hi, I'm having trouble understanding the use of gotoxy in this program given in my text book. It's for converting a decimal to hexadecimal number using for and switch().

They've used an infinite for loop, variables x and z for finding the quotient and remainder of decimal number x when divided by 16.

Then, they initialised a variable y=30, and used a statement

Code:

`gotoxy(y--, 5);`
Then within the for loop comes switch() for printing characters A to F if remainder>9.

I understand everything except the gotoxy part. Oh, and #include<process.h> is also used, and I don't have a clue about it. Help!
• 11-22-2008
rags_to_riches
• 11-22-2008
Beachblue
OK.. so, does it print the last quotient and the preceding remainders in the reverse order?
• 11-22-2008
laserlight
Quote:

Originally Posted by Beachblue
OK.. so, does it print the last quotient and the preceding remainders in the reverse order?

No.

Continue guessing. When you get exactly the right answer we'll say yes. Or maybe you could just stop ignoring rags_to_riches' link.
• 11-23-2008
Beachblue
Quote:

Originally Posted by laserlight
No.

Continue guessing. When you get exactly the right answer we'll say yes. Or maybe you could just stop ignoring rags_to_riches' link.

I'm sorry. I did use the link, and I understood what gotoxy does, viz., set the cursor position on screen. But the definition didn't help me understand its use in this program, which is why I came to this board.
• 11-23-2008
laserlight
Ah, I see. Comment out that line to see what difference it makes when you recompile and run the program.
• 11-23-2008
Beachblue
Yes, it's displaying the output in reverse order. For 31, the hexadecimal value 1F was displayed as F1.

Thank you very much. :)