Getmaxy() Function

  • getmaxy() function is used to fetch the maximum Y coordinate for the current graphics mode or driver.You can learn about graphics mode and graphic driver in chapter Let's Start.
  • Selection of the graphics mode and graphics driver is depending upon the adapter or monitor presents in the user's computer.

Declaration

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

Program

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT, gm, y;

char a[50];

initgraph(&gd,&gm," ");

x=getmaxy();

sprintf(a,"maximum Y coordinate for current graphics driver and graphics mode is %d",y);

outtextxy(30,100,a);

getch();

closegraph();

}

The above program is used to find the maximum Y coordinate for the chosen graphics mode and graphics driver. In the program getmaxy() function is used to fetch the maximum Y coordinate and then store it into the integer type variable y.The above program will give the following output after execution:

Output

c graphics