line() function is used to draw the line from one position to another position on the screen.
- It contains forr arguments, first two arguments represents the X and Y coordinates of the starting point of line and last two arguments represents the X and Y coordinates of the ending point of the line.
- For better understanding go through the program:
int gd=DETECT, gm;
The above program is used to draw the line on the screen. In the above program a line has been drawn with starting point (100,200) and ending point (200,200). It is a horizontal line because only X-coordinate increases and Y- coordinate does not change.