C++ program to draw circles using for loop
kw.cpp
#include <graphics.h>
int main()
{
    int gd = 0, gm = 9, i;
    initgraph(&gd, &gm, NULL);
    for (i = 50; i <= 300; i = i + 50)
    {
        setcolor(15);
        circle(i, i, 30);
    }
    delay(5000);
    return 0;
}
Output
kodingwindow@kw:~$ g++ kw.cpp -lgraph
kodingwindow@kw:~$ ./a.out
Advertisement