Program that draws a line on a grid in C