Thursday , September 21 2017
Home / C / Program in C to draw a STAR

Program in C to draw a STAR

In this program to draw a star you only have to give the coordinates of the lines that make a star.
You have to use the c graphics function line(x1,y1,x2,y2) to draw the line.
#include<stdio.h>
#include<graphics.h>
#include<conio.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\bgi");
line(150,100,100,200);
line(100,200,200,200);
line(200,200,150,100);
line(100,125,200,125);
line(100,125,150,225);
line(150,225,200,125);
getch();
closegraph();
}

 

OUTPUT:

Tags: C program to draw a star pattern, graphics program in c for star.

 

Check Also

How to Solve Linear Equation in One Variable In C Programming?

C Program to Solve any Linear Equation in One Variable Find complete C program to ...

Leave a Reply

Your email address will not be published. Required fields are marked *