hi to all
it is a circle program not running , giving erorrs on my c language but it is working on my friend computer (c language) here is code ;

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
int  main ()
{
int driver,mode, i;
detectgraph(&driver,&mode);
initgraph(&driver,&mode,"...\\ bgi");
setcolor(8);
for(i=10;i<201;i++)
{
sound(i);
circle(300,200,i);
delay(1000);
nosound();
}
getch();
}

Recommended Answers

All 4 Replies

What OS and compiler are you using?

i tried on both dev-C++ 4.9.9.2 and tc v2.01
but in dev it is giving following errors

F:\anny\F graphics.h: No such file or directory.

F:\anny\Untitled6.cpp In function `int main()':

8 F:\anny\Untitled6.cpp `detectgraph' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)

9:25 F:\anny\Untitled6.cpp [Warning] unknown escape sequence '\i'

9 F:\anny\Untitled6.cpp `initgraph' undeclared (first use this function)

10 F:\anny\Untitled6.cpp `setcolor' undeclared (first use this function)

13 F:\anny\Untitled6.cpp `sound' undeclared (first use this function)

14 F:\anny\Untitled6.cpp `circle' undeclared (first use this function)

15 F:\anny\Untitled6.cpp `delay' undeclared (first use this function)

16 F:\anny\Untitled6.cpp `nosound' undeclared (first use this function)

Bottom line... you don't have graphics.h/the compiler doesn't know...
Dev-cpp does not come with graphics.h...

Read this thread...

Also you are compiling the program as a *.cpp. I think it should be *.c. But it's pretty irrelevant since you don't even have the required header file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.