Tuesday 20 November 2012

how to draw concentric circles with help of while loop


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
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: