How do you display a straight line using C++

1 Like

you have to include the graphics directory in your program.

you can try this logic:

Horizontal line from point A(x1,y1) B(x2,y2) start to out put the point from
x1,y1 and then every next loop keep y1 the same and increment x1 by 1.