#include <graphics.h>
#include <bits/stdc++.h>
using namespace std;
void bresen(int x0, int y0, int x1, int y1)
{
    int dx, dy, p, x, y;
    dx=x1-x0;
    dy=y1-y0;
    x=x0;
    y=y0;
    p=2*dy-dx;
    while(x<x1)
    {
        if(p>=0)
        {
            putpixel(x,y,BLUE);
            y=y+1;
            p=p+2*dy-2*dx;
        }
        else
        {
            putpixel(x,y,BLUE);
            p=p+2*dy;
        }
        x=x+1;
    }
}
int main()
{
    int gdriver=DETECT, gmode, x0, y0, x1, 
    initgraph(&gdriver, &gmode,"");
    bresen(100,100,200,200);
    getch();
    closegraph();
    return 0;
}
Here is the screenshot of output screen. I also tried to copy the path of the library folder in initgraph but that is also not working. It is not showing any error on compilation.

 
     
    
