Below is the source code for C Program to Draw Triangle using Graphics which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
/* C Program to Draw Triangles using Graphics */
#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();
}
Above is the source code for C Program to Draw Triangles using Graphics which is successfully compiled and run on Windows System.The Output of the program is shown above .
Below is the source code for C Program to Draw Triangle using Graphics which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
Above is the source code for C Program to Draw Triangles using Graphics which is successfully compiled and run on Windows System.The Output of the program is shown above .
need an explanation for this answer? contact us directly to get an explanation for this answer