• Have Any Question?
  • contact@eitworld.com

Getx() Function





getx() function is used to fetch the X-coordinate of the current position.

Declaration

int getx();
  • For better understanding go through the program:

Program

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT, gm,x;

char a[50];

initgraph(&gd,&gm,” “);

x=getx();

sprintf(a,”current position of X coordinate is %d”,x);

outtext(a);

getch();

closegraph();

}

Above program would display the current position of X-coordinate. It shows a message like “current position of X coordinate is —“.

Output

c graphics



Real Time Web Analytics