Concentric Circles Program in C Graphics
Here you will get the example code to print Concentric Circles program in C Graphics.
What is Concentric Circles
Concentric circles are a set of circles with a shared center point, each having different radius but maintaining the same center. They create a nested appearance and are commonly used in geometry, art, and design to depict symmetry and patterns.
Example code of Concentric Circles Program in C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | //Animated Concentric circles program in c #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int i,gd=DETECT,gm; initgraph(&gd,&gm,"c:\\turboc3\\bgi"); int color=1; while(!kbhit()) { setcolor(color); int x=getmaxx()/2; int y=getmaxy()/2; for(i=2;i<220;i+=4) { setcolor(color); circle(x,y,i); delay(70); } cleardevice(); if(i>=200) { i=2; color++; if(color>15) { color=1; } } } } |
Output