-->
Showing posts with label Program to draw a a line.. Show all posts
Showing posts with label Program to draw a a line.. Show all posts

Program to draw a a line.

using turboc++
--------------------------------------------------------------------------------------------
//drawing triangle
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
clrscr();
int gdriver, gmode;    //variables declaration
gdriver=DETECT;        // detection of graphics driver

initgraph(&gdriver, &gmode, "c:\\tc\\BGI");
line(500,100,300,200);//draws line of two co-ordinates .

getch();          //gets one character from user and closes the graphics.
closegraph();     //closes graphics.h
}