c programming Coding

C program to draw circles in circles

C program to draw circles in circles - c programming - This program draws circles in circles in two different colors which is given below

This program draws circles in circles in two different colors.

C programming code

#include<graphics.h>
#include<conio.h>
#include<dos.h>
 
main()
{
   int gd = DETECT, gm, x, y, color, angle = 0;
   struct arccoordstype a, b;
 
   initgraph(&gd, &gm, "C:\\TC\\BGI");
   delay(2000);
 
   while(angle<=360)
   {
      setcolor(BLACK);
      arc(getmaxx()/2,getmaxy()/2,angle,angle+2,100);
      setcolor(RED);
      getarccoords(&a);
      circle(a.xstart,a.ystart,25);
      setcolor(BLACK);
      arc(getmaxx()/2,getmaxy()/2,angle,angle+2,150);
      getarccoords(&a);
      setcolor(GREEN);
      circle(a.xstart,a.ystart,25);
      angle = angle+5;
      delay(50);
   }
 
   getch();
   closegraph();
   return 0;
}

 

READ  Python Algorithm - Find maximum number of edge disjoint paths between two vertices

About the author

Wikitechy Editor

Wikitechy Editor

Wikitechy Founder, Author, International Speaker, and Job Consultant. My role as the CEO of Wikitechy, I help businesses build their next generation digital platforms and help with their product innovation and growth strategy. I'm a frequent speaker at tech conferences and events.

X