linerel() function

Linerel function draws a line from the current position(CP) to a point that is a relative distance (x, y) from the CP, then advances the CP by (x, y). You can use getx and gety to find the current position.

C programming code for linerel()

#include <graphics.h> 
#include <conio.h>
main()
{
int gd = DETECT, gm;
initgraph(&gd, &gm, "C:\\ TurboC3\\BGI"); 
moveto(250, 250);
linerel(100, -100);
getch(); 
closegraph(); 
return 0;
}