C Program to Draw a Triangle using Graphics Function

January 20, 2025 No Comments » Hits : 404





Write a C Program to Draw A Triangle

//To draw Triangle
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
line(300,100,200,200);
line(300,100,400,200);
line(200,200,400,200);
getch();
closegraph();
}

Incoming search terms: