0

Hey friends i just want some help....well got a simple task this weekend to make a rings of different colors using circles....like i want an output in which a circle appear on top left and after little delay another one appear near to the first one...and so on......and all should be in different colors...

i have made a program using multiple circle commands in loops but just want to compact it...

so what should i do to make a loop which uses one command of circle(x,y,radius) and with a difference of say 10,5 make another and so on....

i`m sorry that this simple things ain`t not comin to my mind...please an c++ champion who can help...just tell me the loop coding !!

cheers !!

3
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by rsashwinkumar
0

Hi friend I am a class XII, R.S.A.
Here is the code you required:
//developed by R.S.A.
#include<graphics.h>
#include<dos.h>
#include<conio.h>
#include<stdio.h>
#include<figures.h>
#include<stdlib.h>
void main()
{
textbackground(RED);
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"");
static int i=19,j=0,r=18;
for(int a=0;a<=100;a++)
{
if(i<500)
{
setcolor(random(10));
circle(i,j,r);
i=i+36;
}
if(i>=500)
{
i=19;
j=j+36;
setcolor(random(10));
circle(i,j,r);
}
sleep(1);
if(kbhit())
exit(0);
}
getch();
}

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.