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