C Graphics Program to Draw & Fill Hexagon & Polygon on Command Line

You are currently viewing C Graphics Program to Draw & Fill Hexagon & Polygon on Command Line

C Graphics Program to Draw & Fill Hexagon & Polygon on Command Line

/* Program to draw & fill
Triangle & Hexagon */
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm;
int np=4,tri[8]={200,50,150,100,250,100,200,50};
int hex[14]={400,50,450,50,500,100,450,150,400,150,350,100,400,50};
initgraph(&gd,&gm,"c:\\turboc3\\");
drawpoly(np,tri);
np=7;
drawpoly(np,hex);
getch();
closegraph();
}

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply