getmaxx() function

getmaxx function returns the maximum X coordinate for current graphics mode and driver. 

Declaration of getmaxx() function

int getmaxx();

C program for getmaxx 

#include<graphics.h> 
#include<conio.h>
main()
{
int gd = DETECT, gm, max_x; 
char array[100];
initgraph(&gd,&gm,"C:\\ TurboC3\\BGI"); 
max_x = getmaxx();
sprintf(array, "Maximum X coordinate for current graphics mode and driver =
%d.",max_x); 
outtext(array);
getch(); 
closegraph(); 
return 0;
}