 Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you the use of two functions that are draw poly and fill poly used in graphics in C before starting you can subscribe my YouTube channel by clicking on the link which is available at bottom right corner of this video. You can download my app TechMS that is available on Google Play. You can connect with me by following these details which are available in front of you. Now coming on to the topic, first I am including two header files. First one is graphics.h and second one is conio.h. Then I am defining main function. Inside main function I am declaring first variable gd and second variable gm. gd stands for graphics driver and gm graphics mode. gd is initialized with detect. So detect is a predefined macro which will automatically identify required drivers for the graphics. Now I am using init graph function. It requires three arguments gd, gm and path for graphics library that is v, tc and bgi. After init graph function I can call fill poly or draw poly functions. So before that I have to declare various points so that we can draw a poly or polygon. So I am declaring a variable points. It is an array. Inside this array I am mentioning some coordinate points. These are the points for polygon. So first two arguments 320 and 150 will draw first point. Then 440 and 340 will draw second point. Then 230 and 340, third point and 320 and 150, fourth point. You can see first and fourth point are same. So starting from first to second point, second to third and third to first. So this way it will draw a polygon where four points will be available and it will draw three lines. Now first I am calling draw poly function. I am passing 4 comma points array. So draw poly will draw four points and polygon will be drawn on console. Then I am using getch function. Then close graph function and then return zero. Getch will hold the screen. Close graph will deallocate the graphics memory and return zero because return type of main is integer. That's why this zero is returned from here. So draw poly function is called here which is having two arguments. First is number of points and second one is the coordinates which we have to draw. Now I am executing this code. You can see a polygon is drawn. It is actually a triangle. It is having four points. First and last points indicates to same location and rest of the points indicates to the different locations. Now it is drawn in white color. If you want to change the color of this polygon, you can use set color function. I am passing red color inside set color function. You can see polygon is drawn in red color. Now if you want to fill this polygon, you can use fill poly function. Now you can see polygon is filled with white color. If you want to apply some styles, then you can call set fill style function. So there are various predefined styles available. These are some predefined set fill styles. You can use any fill style from the list which is available in front of you. So I am using this slash underscore fill using it in red color. You can see polygon is drawn with a particular fill style. Its border is in white color and the particular fill style that I have used is applied on this polygon. So if you want to fill the polygon, then you have to use fill poly function and if you want to draw an empty polygon, then you can use draw polygon. You can increase these number of points if you want to draw any other shape with the help of these two functions. I hope you have understood the concept how we can draw polygon with draw poly and fill poly functions. If you want to watch more programming related videos, you can subscribe my YouTube channel. Thank you for watching this video.