Myth0147

Untitled

Jan 28th, 2016
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. #include<conio.h>
  4. #include<graphics.h>
  5. Void main()
  6. {
  7. int gd=DETECT,gm;
  8. int xcentre=200,ycentre=200,r,x,y;
  9. initgraph(&gd,&gm,"C:\\TC\\BGI");
  10. printf("enter the radious");
  11. scanf("%d",&r);
  12. for(x=-r;x<=r;x++)
  13. {
  14. y=sqrt((r*r)-(x*x));
  15. putpixel(x+xcentre,y+ycentre,RED);
  16. putpixel(x+xcentre,-y+ycentre,BLUE);
  17. }
  18. getch();
  19. }
Add Comment
Please, Sign In to add comment