Featured Post

Step Wise Project Planning

Planning is the most difficult process in project management. The framework described is called the Stepwise method to help to distinguis...

  1. Home

Write a program to move a character along radius

#include<graphics.h>
#include<math.h>
void main()
{
int x_cor,y_cor,radius,i;
int gd=DETECT,gm;
printf("Enter Centre Co-ordinates of a circle :- ");
scanf("%d %d",&x_cor,&y_cor);
printf("\n Enter the Radius of a Circle:- ");
scanf("%d",&radius);
initgraph(&gd,&gm," ");
for(i=0;i<=radius;i++)
{
cleardevice();
circle(x_cor,y_cor,radius);
line(x_cor,y_cor,x_cor+radius,y_cor);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
outtextxy(x_cor+i,y_cor-32,"M");
delay(50);
}
getch();
}
Previous
Next Post »