You are here

gety function in c

gety function returns the y coordinate of current position.

Declaration: int gety();

C programming source code for gety

  1. #include <graphics.h>
  2. #include <conio.h>
  3.  
  4. main()
  5. {
  6.    int gd = DETECT, gm, y;
  7.    char array[100];
  8.  
  9.    initgraph(&gd, &gm, "C:\\TC\\BGI");
  10.  
  11.    y = gety();
  12.    
  13.    sprintf(array, "Current position of y = %d", y);
  14.  
  15.    outtext(array);
  16.  
  17.    getch();
  18.    closegraph();
  19.    return 0;
  20. }