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![]()
Comments and Reactions
What Next?
C++ program to draw a quarter color-filled circle using the pieslice function
C++ program to draw a color-filled circle using the pieslice function
C++ program to draw a circle using the arc function
Advertisement