#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<math.h>int main()
{
int x0, y0, x1, y1,dx,dy,x,y;
printf("Enter co-ordinates of first point: ");
scanf("%d %d", &x0, &y0);
printf("Enter co-ordinates of second point: ");
scanf("%d %d", &x1, &y1);
dx=x1-x0;
dy=y1-y0;
x=x0;
y=y0;
p=2*dy-dx;
while(x<x1)
{
if(p>=0)
{
printf("(%d,%d)",x,y);
y=y+1;
p=p+2*dy-2*dx;
}
else
{
printf("(%d,%d)",x,y);
p=p+2*dy;
}
x=x+1;
}
return 0;}