graphics.h library is used to draw a line in computer graphics in c++. graphics.h lib…
closegraph deallocates all the allocated memory of the graphics system. It then resto…