Programming with Passion

Make the best out of everything.

Wednesday 16 March 2016

C graphics examples

C graphics examples

1. Drawing concentric circles
#include <graphics.h>
 
int main()
{ 
   int gd = DETECT, gm;
   int x = 320, y = 240, radius;
 
   initgraph(&gd, &gm, "C:\\TC\\BGI");
 
   for ( radius = 25; radius <= 125 ; radius = radius + 20)
      circle(x, y, radius);
 
   getch();
   closegraph();
   return 0;
}

No comments:

Post a Comment