C++ program to draw a counter-clockwise spiral using the arc function
kw.cpp
#include <graphics.h>
int main()
{
    int gd = 0, gm = 9, x;
    initgraph(&gd, &gm, NULL);
    for (x = 0; x <= 210; x = x + 20)
    {
        arc(300, 250, 180, 0, 10 + x);
        arc(310, 250, 0, 180, 20 + x);
    }
    delay(7000);
    return 0;
}
Output
kodingwindow@kw:~$ g++ kw.cpp -lgraph
kodingwindow@kw:~$ ./a.out
Advertisement