The easy solution is to not use gotoxy(). It's a Borland holdover from the days of yore where 640K wasn't a laughably small amount of memory. Get with the times and write a real GUI if you need more control than the command prompt provides.
Alternatively, you can search google. Beginners too entrenched in their Turbo C++ ways have asked the same question countless times.