C++ program to draw concentric color-filled circles from a fixed point
kw.cpp
#include <graphics.h>
int main()
{
    int gd = 0, gm = 9, i, color = 1;
    initgraph(&gd, &gm, NULL);
    for (i = 150; i >= 0; i = i - 10)
    {
        setcolor(color++);
        pieslice(200, 20 + i, 0, 360, i);
        delay(400);
    }
    delay(7000);
    return 0;
}
Output
kodingwindow@kw:~$ g++ kw.cpp -lgraph
kodingwindow@kw:~$ ./a.out
Advertisement