#include"stdio.h"
#include"graphics.h"
#include"conio.h"
#include"math.h"
void main()
{
int h,k;
float r,x,y;
int i=DETECT,M,g;
clrscr();
initgraph(&i,&M,"");
printf("Enter the values of h,k,r");
scanf("%d%d%f",&h,&k,&r);
for(x=0;x<=r/sqrt(2);x++)
{
y=sqrt(r*r-x*x);
putpixel(h+x,y+k,1);
putpixel(h+x,-y+k,2);
putpixel(-y+h,x+k,3);
putpixel(-y+h,-x+k,4);
putpixel(-x+h,-y+k,5);
putpixel(-x+h,y+k,6);
putpixel(y+h,-x+k,7);
putpixel(y+h,x+k,8);
}
getch();
}
Tuesday, 16 December 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment