Below is the Opengl Computer Graphics program to draw a line using Dda Algorithm (digital differential analyzer algorithm).
// delimit the vertices of a primitive or a group of like primitives
void glEnd(void);
// delimit the vertices of a primitive or a group of like primitives
void glClear(GLbitfield mask);
// clear preset values of buffer
void glVertex2d(GLdouble x, GLdouble y);
// specifies vertex
void glFluch(void);
// force execution of GL commands in finite time