concentric circles which share same axis ,center and origin.
so sphere and disks are concentric circle we can assume.
#include<graphics.h> //graphic shows header file for design in c language.
main()
{
int gd=DETECT,gm;
int n,x=10;
initgraph(&gd,&gm," ");
printf("How many concentric circles do you want?");//asking for number of circle want to draw.
scanf("%d",&n);
while(n!=0)
{
circle(240,150,x);
setcolor(GREEN);// setting color as green.
x+=10;
n--;
}
getch(); // end of main
closegraph();
}
programming examples for concentric circles
0 comments: