You are here

gotoxy in C

gotoxy in C: gotoxy function places cursor at a desired location on screen i.e., we can change cursor position using gotoxy function.

Declaration: void gotoxy(int x, int y);
where (x, y) is the position where we want to place the cursor.

C programming code for gotoxy

  1. // Works in Turbo C compiler only
  2. #include <stdio.h>
  3. #include <conio.h>
  4.  
  5. int main()
  6. {
  7.    int x, y;
  8.  
  9.    x = 10;
  10.    y = 10;
  11.  
  12.    gotoxy(x, y);
  13.  
  14.    printf("C program to change cursor position.");
  15.  
  16.    getch();
  17.    return 0;
  18. }