Program 1:
#include<stdio.h>
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<stdlib.h>
void main()
{int p,q,r;
int x,y;
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, "..\\bgi");
x=getmaxx()/2;
y=getmaxy()/2;
for(q=1;q<15;q++)
{
setcolor(q);
for(p=400;p>1;p--)
{
circle(x,y,p);
}
setcolor(q+2);
for(r=1;r<400;r++)
{
circle(x,y,r);
}
}
getch();
}
Program 2:
#include<graphics.h>
#include<stdio.h>
#include<dos.h>
#include<conio.h>
main()
{
int gd=DETECT,gm,col=0;
initgraph(&gd,&gm,"..\\bgi");
while(!kbhit())
{
setcolor(15);
circle(col,100,50);
delay(50);
col++;
if(col>=600)
col=0;
cleardevice();
}
}
Program 3:
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<dos.h>
#include<math.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"..\\bgi");
int x=100,y=100,r=20;
float c=.1;
for(float i=0;i<100;i=i+.1)
{
delay(50);
cleardevice();
line(x+i,y,x+i+r*cos(i),y+r*sin(i));
line(x+i,y,x+i+r*cos(90+i),y+r*sin(90+i));
line(x+i,y,x+i+r*cos(135+i),y+r*sin(135+i));
line(x+i,y,x+i+r*cos(180+i),y+r*sin(180+i));
line(x+i,y,x+i+r*cos(225+i),y+r*sin(225+i));
line(x+i,y,x+i+r*cos(315+i),y+r*sin(315+i));
circle(x+i,y,r);
if(kbhit())
{
if(getch())
{
printf("break");
if(getch()){}
}
}
}
// getch();
}
#include<stdio.h>
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<stdlib.h>
void main()
{int p,q,r;
int x,y;
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, "..\\bgi");
x=getmaxx()/2;
y=getmaxy()/2;
for(q=1;q<15;q++)
{
setcolor(q);
for(p=400;p>1;p--)
{
circle(x,y,p);
}
setcolor(q+2);
for(r=1;r<400;r++)
{
circle(x,y,r);
}
}
getch();
}
Program 2:
#include<graphics.h>
#include<stdio.h>
#include<dos.h>
#include<conio.h>
main()
{
int gd=DETECT,gm,col=0;
initgraph(&gd,&gm,"..\\bgi");
while(!kbhit())
{
setcolor(15);
circle(col,100,50);
delay(50);
col++;
if(col>=600)
col=0;
cleardevice();
}
}
Program 3:
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<dos.h>
#include<math.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"..\\bgi");
int x=100,y=100,r=20;
float c=.1;
for(float i=0;i<100;i=i+.1)
{
delay(50);
cleardevice();
line(x+i,y,x+i+r*cos(i),y+r*sin(i));
line(x+i,y,x+i+r*cos(90+i),y+r*sin(90+i));
line(x+i,y,x+i+r*cos(135+i),y+r*sin(135+i));
line(x+i,y,x+i+r*cos(180+i),y+r*sin(180+i));
line(x+i,y,x+i+r*cos(225+i),y+r*sin(225+i));
line(x+i,y,x+i+r*cos(315+i),y+r*sin(315+i));
circle(x+i,y,r);
if(kbhit())
{
if(getch())
{
printf("break");
if(getch()){}
}
}
}
// getch();
}