Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  sdfg
Language: C/C++
Code:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
void main()
{
  int gdriver=DETECT,gmode,i=1,rds;
  float stx,sty,x1,x2,y1,y2,ep;
  initgraph(&gdriver,&gmode," ");
  printf("enter radius=");
  scanf("%d",&rds);
  while(rds>pow(2,i))
  i++;
  ep=1/pow(2,i);
  x1=rds;
  y1=0;
  stx=rds;
  sty=0;
  do
  {
    x2=x1+(y1*ep);
    y2=y1+(x2*ep);
    putpixel(x2+200,y2+200,10);
    x1=x2;
    y1=y2;
  }
  while((y1-sty)<ep||(stx-x1)>ep);
  getch();
}
Comments: