C++ program to draw a dotted line using the setline function
codeaft.cpp
#include <graphics.h>
int main()
{
    int gd = 0, gm = 9;
    initgraph(&gd, &gm, NULL);
    setlinestyle(DOTTED_LINE, 5, NORM_WIDTH);
    setcolor(15);
    line(50, 50, 150, 150);
    delay(2000);
    return 0;
}
Output
codeaft@codeaft:~$ g++ codeaft.cpp -lgraph
codeaft@codeaft:~$ ./a.out
Comments and Reactions