Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have c code but it is not working on visual studio. can you fix it please? #include #include #include void main() { int DETECT;
I have c code but it is not working on visual studio.
can you fix it please?
#include
#include
#include
void main()
{
int DETECT;
int RED;
int SOLID_FILL;
int gd = DETECT, gm = DETECT;
int x, y = 0, j, t = 400, c = 1;
initgraph(&gd, &gm, "");
setcolor(RED);
setfillstyle(SOLID_FILL, RED);
for (x = 40; x < 602; x++)
{
cleardevice();
circle(x, y, 30);
floodfill(x, y, RED);
delay(40);
if (y >= 400)
{
c = 0; t -= 20;
}
if (y <= (400 - t))
c = 1;
y = y + (c ? 15 : -15);
}
getch();
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started