Draw Colored Lines using C/C++


#include<stdio.h>
#include<graphics.h>
#include<conio.h>

int main()
{
   int gd = DETECT,gm;
   int x ,y;
   initgraph(&gd, &gm, "");

  /* Draw line on screen */
   setcolor(RED);
   line(100,200,50,30);
   setcolor(GREEN);
   line(100,400,55,50);
   setcolor(YELLOW);
   line(100,300,70,45);
   setcolor(GREEN);
   line(100,150,45,60);
   getch();
   closegraph();
   return 0;
}

No comments:

Post a Comment