fillpoly function in c

Fillpoly function draws and fills a polygon. It require same arguments as drawpoly.

Declaration :- void drawpoly( int num, int *polypoints );
For details of arguments see drawpoly.
fillpoly fills using current fill pattern and color which can be changed using setfillstyle.

C programming code

#include <graphics.h>
#include <conio.h>
 
main()
{
   int gd=DETECT,gm,points[]={320,150,440,340,230,340,320,150};
 
   initgraph(&gd, &gm, "C:\\TC\\BGI");
 
   fillpoly(4, points);
 
   getch();
   closegraph();
   return 0;
}
randomness