C Program to Draw a Triangle using Graphics Function

C Program to Draw a Triangle using Graphics Function.


C Program to Draw a Triangle using Graphics Function Images-Pics-Pictures-Photos-Basic C Programs-C Language Programs-C Program to draw a Triangle in Graphics Mode-General C Programs-Program for Triangle-Triangle Program-Graphics Programs.

InitGraph initializes the graphics system by loading a graphics driver from disk then putting the system into graphics mode

closegraph( ) function switches back the screen from graphics mode to text mode.


--------------------------------------------------------------------------------------------------------------------------

#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( );
}

--------------------------------------------------------------------------------------------------------------------------

Output

--------------------------------------------------------------------------------------------------------------------------

Displays Triangle

     



EmoticonEmoticon