Line function in c graphics


Line function in c graphics

line() :

It draws a line between two specific points.

Syntax :

line(int x1,int y1,int x2,int y2);

where

x1,y1----starting point

x2,y2---ending point

Example :


#include <graphics.h>
#include <conio.h>

void main()
{
int d,m;

d=DETECT;
initgraph(&d,&m,"c:\\tc\\bgi");

line(50,50,500,50);

getch();
closegraph;
}

Output :


0 comments:

Post a Comment