You are here

getmaxx and getmaxy functions in c

Declarations :-

int getmaxx();
int getmaxy();

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

C programming code

  1. #include<graphics.h>
  2. #include<conio.h>
  3. #include<stdio.h>
  4.  
  5. main()
  6. {
  7.    int gd = DETECT, gm, maxx, maxy;
  8.    char a[100];
  9.    
  10.    initgraph(&gd,&gm,"C:\\TC\\BGI");
  11.  
  12.    maxx = getmaxx();
  13.    maxy = getmaxy();
  14.  
  15.    sprintf(a,"Maximum X and Y coordinates for current graphics mode and driver are %d and %d respectively.",maxx,maxy);
  16.    outtext(a);
  17.    
  18.    getch();
  19.    closegraph();
  20.    return 0;
  21. }