Program to make screen saver in that display different size circles filled with different colors and at random places.
- #include<stdio.h>
- #include<conio.h>
- #include"graphics.h"
- #include"stdlib.h"
- void main()
- {
- intgd=DETECT,gm,i=0,x,xx,y,yy,r;
-
- initgraph(&gd,&gm,"c:\\tc\\bgi");
- x=getmaxx();
- y=getmaxy();
- while(!kbhit())
- {
- i++;
-
-
- circle(xx=random(x),yy=random(y),random(30));
- setfillstyle(random(i),random(30));
- floodfill(xx,yy,getmaxcolor());
- delay(200);
- }
- getch();
- }
Output
